oota-llvm.git
11 years agoRemove intrinsic specific instructions for CVTPD2DQ. Replace with patterns.
Craig Topper [Sun, 24 Jun 2012 05:33:24 +0000 (05:33 +0000)]
Remove intrinsic specific instructions for CVTPD2DQ. Replace with patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159105 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTab to spaces. No functionality change.
Nick Lewycky [Sun, 24 Jun 2012 04:07:14 +0000 (04:07 +0000)]
Tab to spaces. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159104 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/lib/Support/Errno.cpp: [Win32] Fix usage of strerror_s().
NAKAMURA Takumi [Sun, 24 Jun 2012 03:51:04 +0000 (03:51 +0000)]
llvm/lib/Support/Errno.cpp: [Win32] Fix usage of strerror_s().

FYI, two arguments of strerror_s() is provided in C++ on msvc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159103 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLLVMProcessSources.cmake: [MSVC] Don't add "PROPERTIES HEADER_FILE_ONLY" to *.def.
NAKAMURA Takumi [Sun, 24 Jun 2012 03:50:58 +0000 (03:50 +0000)]
LLVMProcessSources.cmake: [MSVC] Don't add "PROPERTIES HEADER_FILE_ONLY" to *.def.

FIXME: Shall we put *.def(s) to the folder?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159102 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/Support/IntegersSubset.h: Add a copy constructor on IntegersSubset to appease...
NAKAMURA Takumi [Sun, 24 Jun 2012 03:48:53 +0000 (03:48 +0000)]
llvm/Support/IntegersSubset.h: Add a copy constructor on IntegersSubset to appease msvc.

msvc mis-infers ParentTy(RHS) to (const RangesCollectionTy &).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159101 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/Support/IntegersSubset.h: Fix whitespace.
NAKAMURA Takumi [Sun, 24 Jun 2012 03:48:47 +0000 (03:48 +0000)]
llvm/Support/IntegersSubset.h: Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159100 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agounittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.
NAKAMURA Takumi [Sun, 24 Jun 2012 03:48:40 +0000 (03:48 +0000)]
unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159099 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agounittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.
NAKAMURA Takumi [Sun, 24 Jun 2012 03:48:34 +0000 (03:48 +0000)]
unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159098 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoVMCore/CMakeLists.txt: [CMake][MSVC] Add "/Og-" to Function.cpp on msvc10. Otherwise...
NAKAMURA Takumi [Sun, 24 Jun 2012 03:48:29 +0000 (03:48 +0000)]
VMCore/CMakeLists.txt: [CMake][MSVC] Add "/Og-" to Function.cpp on msvc10. Otherwise, it took over 20 minutes to compile.

FIXME: Suppressing optimizations to core libraries would not be good thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159097 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a dangling reference to a deleted instruction. Fixes PR13185!
Nick Lewycky [Sun, 24 Jun 2012 01:44:08 +0000 (01:44 +0000)]
Remove a dangling reference to a deleted instruction. Fixes PR13185!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159096 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove code i'd been testing with but didn't mean to commit. Oops
Pete Cooper [Sun, 24 Jun 2012 00:08:36 +0000 (00:08 +0000)]
Remove code i'd been testing with but didn't mean to commit.  Oops

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159094 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDAG legalisation can now handle illegal fma vector types by scalarisation
Pete Cooper [Sun, 24 Jun 2012 00:05:44 +0000 (00:05 +0000)]
DAG legalisation can now handle illegal fma vector types by scalarisation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159092 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove intrinsic specific instructions for (V)CVTDQ2PS. Use a Pat instead instead.
Craig Topper [Sat, 23 Jun 2012 22:33:14 +0000 (22:33 +0000)]
Remove intrinsic specific instructions for (V)CVTDQ2PS. Use a Pat instead instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159090 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow BBVectorize to fuse compare instructions.
Hal Finkel [Sat, 23 Jun 2012 21:52:50 +0000 (21:52 +0000)]
Allow BBVectorize to fuse compare instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159088 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake CVTDQ2PS instruction use SSE2 predicate instead of SSE1. No functional change...
Craig Topper [Sat, 23 Jun 2012 20:52:45 +0000 (20:52 +0000)]
Make CVTDQ2PS instruction use SSE2 predicate instead of SSE1. No functional change because there are no patterns in the instructions. Also fix a typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159087 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove CVTPD2DQ to use SSE2 predicate instead of SSE3. Move DQ2PD and PD2DQ to the...
Craig Topper [Sat, 23 Jun 2012 20:15:42 +0000 (20:15 +0000)]
Move CVTPD2DQ to use SSE2 predicate instead of SSE3. Move DQ2PD and PD2DQ to the SSE2 section of the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159086 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a microoptimization note.
Benjamin Kramer [Sat, 23 Jun 2012 15:19:31 +0000 (15:19 +0000)]
Add a microoptimization note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159082 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd relocation types for Hexagon processor; patch by Sidney Manning <sidneym@codeauro...
Marshall Clow [Sat, 23 Jun 2012 14:46:18 +0000 (14:46 +0000)]
Add relocation types for Hexagon processor; patch by Sidney Manning <sidneym@codeaurora.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159081 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClean-up after r159077.
Hans Wennborg [Sat, 23 Jun 2012 12:14:23 +0000 (12:14 +0000)]
Clean-up after r159077.

Remove temporary GlobalVariable constructors now that Clang has been
updated (r159078).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159079 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExtend the IL for selecting TLS models (PR9788)
Hans Wennborg [Sat, 23 Jun 2012 11:37:03 +0000 (11:37 +0000)]
Extend the IL for selecting TLS models (PR9788)

This allows the user/front-end to specify a model that is better
than what LLVM would choose by default. For example, a variable
might be declared as

  @x = thread_local(initialexec) global i32 42

if it will not be used in a shared library that is dlopen'ed.

If the specified model isn't supported by the target, or if LLVM can
make a better choice, a different model may be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159077 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOptimized usage of new SwitchInst case values (IntegersSubset type) in Local.cpp...
Stepan Dyatkovskiy [Sat, 23 Jun 2012 10:58:58 +0000 (10:58 +0000)]
Optimized usage of new SwitchInst case values (IntegersSubset type) in Local.cpp, Execution.cpp and BitcodeWriter.cpp.
I got about 1% of compile-time improvement on my machines (Ubuntu 11.10 i386 and Ubuntu 12.04 x64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159076 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse correct memory types for (V)CVTDQ2PD instructions.
Craig Topper [Sat, 23 Jun 2012 08:30:27 +0000 (08:30 +0000)]
Use correct memory types for (V)CVTDQ2PD instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159075 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSilence an unused variable warning on release builds.
Craig Topper [Sat, 23 Jun 2012 08:09:30 +0000 (08:09 +0000)]
Silence an unused variable warning on release builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159074 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCompress flags in X86 op folding to reduce space in static tables.
Craig Topper [Sat, 23 Jun 2012 08:01:18 +0000 (08:01 +0000)]
Compress flags in X86 op folding to reduce space in static tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159073 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake helper method static since it doesn't use anything in the class.
Craig Topper [Sat, 23 Jun 2012 04:58:41 +0000 (04:58 +0000)]
Make helper method static since it doesn't use anything in the class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159071 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove intrinsic specific instructions for 128-bit (V)CVTDQ2PD. Replace with intrinsi...
Craig Topper [Sat, 23 Jun 2012 04:23:36 +0000 (04:23 +0000)]
Remove intrinsic specific instructions for 128-bit (V)CVTDQ2PD. Replace with intrinsic patterns. Mem forms omitted because the load size is only 64-bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159070 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach LiveVariables to handle <undef> operands.
Jakob Stoklund Olesen [Sat, 23 Jun 2012 02:23:00 +0000 (02:23 +0000)]
Teach LiveVariables to handle <undef> operands.

It's simple: Don't treat <undef> operands as uses, and don't assume a
virtual register has a defining instruction unless a real use has been
seen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159061 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHandle aliases to tls variables in all architectures, not just x86.
Rafael Espindola [Sat, 23 Jun 2012 00:30:03 +0000 (00:30 +0000)]
Handle aliases to tls variables in all architectures, not just x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159058 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago(sub X, imm) gets canonicalized to (add X, -imm)
Evan Cheng [Sat, 23 Jun 2012 00:29:06 +0000 (00:29 +0000)]
(sub X, imm) gets canonicalized to (add X, -imm)

There are patterns to handle immediates when they fit in the immediate field.
e.g. %sub = add i32 %x, -123
=>   sub r0, r0, #123
Add patterns to catch immediates that do not fit but should be materialized
with a single movw instruction rather than movw + movt pair.
e.g. %sub = add i32 %x, -65535
=>   movw r1, #65535
     sub r0, r0, r1

rdar://11726136

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159057 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBoundsChecking: attach debug info to traps to make my life a bit more sane
Nuno Lopes [Sat, 23 Jun 2012 00:12:34 +0000 (00:12 +0000)]
BoundsChecking: attach debug info to traps to make my life a bit more sane

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159055 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Add a better diagnostic for some out of range immediates.
Jim Grosbach [Fri, 22 Jun 2012 23:56:48 +0000 (23:56 +0000)]
ARM: Add a better diagnostic for some out of range immediates.

As an example of how the custom DiagnosticType can be used to provide
better operand-mismatch diagnostics, add a custom diagnostic for
the imm0_15 operand class used for several system instructions.
Update the tests to expect the improved diagnostic.

rdar://8987109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159051 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTableGen: AsmMatcher support for better operand diagnostics.
Jim Grosbach [Fri, 22 Jun 2012 23:56:44 +0000 (23:56 +0000)]
TableGen: AsmMatcher support for better operand diagnostics.

"Invalid operand" may be a completely correct diagnostic, but it's often
insufficiently specific to really help identify and fix the problem in
assembly source. Allow a target to specify a more-specific diagnostic kind
for each AsmOperandClass derived definition and use that to provide
more detailed diagnostics when an operant of that class resulted in a
match failure.

rdar://8987109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159050 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for the PPC isel instruction.
Hal Finkel [Fri, 22 Jun 2012 23:10:08 +0000 (23:10 +0000)]
Add support for the PPC isel instruction.

The isel (integer select) instruction is supported on the 440 and A2
embedded cores and on the POWER7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159045 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFileCheckize tests.
Chad Rosier [Fri, 22 Jun 2012 23:04:02 +0000 (23:04 +0000)]
FileCheckize tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159044 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename fp-op fusion option (yet again) for compatibility with GCC option.
Lang Hames [Fri, 22 Jun 2012 22:31:00 +0000 (22:31 +0000)]
Rename fp-op fusion option (yet again) for compatibility with GCC option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159042 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove ProcessImplicitDefs.h which was unused.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 22:27:36 +0000 (22:27 +0000)]
Remove ProcessImplicitDefs.h which was unused.

The ProcessImplicitDefs class can be local to its implementation file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159041 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAlso verify the def index for early clobbers.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 22:23:58 +0000 (22:23 +0000)]
Also verify the def index for early clobbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159039 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhitespace.
Chad Rosier [Fri, 22 Jun 2012 22:07:19 +0000 (22:07 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159035 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDelete a boring statistic.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 20:40:15 +0000 (20:40 +0000)]
Delete a boring statistic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159030 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStore live intervals in an IndexedMap.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 20:37:52 +0000 (20:37 +0000)]
Store live intervals in an IndexedMap.

It is both smaller and faster than DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159029 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoForgot this patch in r159023.
Evan Cheng [Fri, 22 Jun 2012 20:30:39 +0000 (20:30 +0000)]
Forgot this patch in r159023.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159028 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r158679 - use case is unclear (and it increases the memory footprint).
Hal Finkel [Fri, 22 Jun 2012 20:27:13 +0000 (20:27 +0000)]
Revert r158679 - use case is unclear (and it increases the memory footprint).

Original commit message:
    Allow up to 64 functional units per processor itinerary.

    This patch changes the type used to hold the FU bitset from unsigned to uint64_t.
    This will be needed for some upcoming PowerPC itineraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159027 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEmitZerofill should take a 64-bit size or else it's chopping off large zero-filled...
Evan Cheng [Fri, 22 Jun 2012 20:14:46 +0000 (20:14 +0000)]
EmitZerofill should take a 64-bit size or else it's chopping off large zero-filled global. rdar://11729134

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159023 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a crash in --debug code.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 19:51:41 +0000 (19:51 +0000)]
Fix a crash in --debug code.

Don't try to print out the live range of a physreg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159021 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't depend on live ranges being present.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 18:51:35 +0000 (18:51 +0000)]
Don't depend on live ranges being present.

DBG_VALUE instructions could be referring to non-existing virtual
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159020 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify handleMove() a bit.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 18:38:57 +0000 (18:38 +0000)]
Simplify handleMove() a bit.

There is no need to check for physreg live ranges. They don't exist any
more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159019 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStop computing physreg live ranges.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 18:20:50 +0000 (18:20 +0000)]
Stop computing physreg live ranges.

Everyone is using on-demand regunit ranges now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159018 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReverting makefile change wile I figure out what the heck happened
Marshall Clow [Fri, 22 Jun 2012 18:12:28 +0000 (18:12 +0000)]
Reverting makefile change wile I figure out what the heck happened

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159017 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove some redundant LIS->hasInterval() checks.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 17:49:44 +0000 (17:49 +0000)]
Remove some redundant LIS->hasInterval() checks.

These functions only operate on virtual registers now, and they all have
live ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159015 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded building yaml2obj to the configure+make build system
Marshall Clow [Fri, 22 Jun 2012 17:43:40 +0000 (17:43 +0000)]
Added building yaml2obj to the configure+make build system

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159014 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse MRI::isConstantPhysReg() to check remat feasibility.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 17:31:01 +0000 (17:31 +0000)]
Use MRI::isConstantPhysReg() to check remat feasibility.

Don't depend on LiveIntervals::hasInterval() to determine if a physreg
is reserved and constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159013 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a variable that is unused when assertions aren't enabled.
Kaelyn Uhrain [Fri, 22 Jun 2012 17:18:15 +0000 (17:18 +0000)]
Remove a variable that is unused when assertions aren't enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159011 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse regunit liveness to guide LiveDebugVariables.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 17:15:32 +0000 (17:15 +0000)]
Use regunit liveness to guide LiveDebugVariables.

This should produce the same results as using physreg liveness directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159009 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove LiveIntervals::trackingRegUnits().
Jakob Stoklund Olesen [Fri, 22 Jun 2012 16:46:44 +0000 (16:46 +0000)]
Remove LiveIntervals::trackingRegUnits().

With regunit liveness permanently enabled, this function would always
return true.

Also remove now obsolete code for checking physreg interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159006 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert remaining part of r93200: "Disable folding sext(trunc(x)) -> x"
Jakob Stoklund Olesen [Fri, 22 Jun 2012 16:36:43 +0000 (16:36 +0000)]
Revert remaining part of r93200: "Disable folding sext(trunc(x)) -> x"

This fixes PR5997.

These transforms were disabled because codegen couldn't deal with other
uses of trunc(x). This is now handled by the peephole pass.

This causes no regressions on x86-64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159003 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange comment into proper Doxygen member comment.
Dmitri Gribenko [Fri, 22 Jun 2012 16:00:48 +0000 (16:00 +0000)]
Change comment into proper Doxygen member comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159000 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agosimplify code from previous commits (Thanks Duncan)
Nuno Lopes [Fri, 22 Jun 2012 15:50:53 +0000 (15:50 +0000)]
simplify code from previous commits (Thanks Duncan)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158999 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed r158979.
Stepan Dyatkovskiy [Fri, 22 Jun 2012 14:53:30 +0000 (14:53 +0000)]
Fixed r158979.
Original message:
Performance optimizations:
- SwitchInst: case values stored separately from Operands List. It allows to make faster access to individual case value numbers or ranges.
- Optimized IntItem, added APInt value caching.
- Optimized IntegersSubsetGeneric: added optimizations for cases when subset is single number or when subset consists from single numbers only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158997 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agotest/CodeGen/Generic/asm-large-immediate.ll: Mark it as XFAIL: powerpc, possibly...
NAKAMURA Takumi [Fri, 22 Jun 2012 13:41:00 +0000 (13:41 +0000)]
test/CodeGen/Generic/asm-large-immediate.ll: Mark it as XFAIL: powerpc, possibly due to r158939.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158994 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove another duplicated variable. We only need one to tell us if the linker
Rafael Espindola [Fri, 22 Jun 2012 13:32:49 +0000 (13:32 +0000)]
Remove another duplicated variable. We only need one to tell us if the linker
knows dwarf or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158993 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a FIXME: DwarfRequiresRelocationForSectionOffset is the same as
Rafael Espindola [Fri, 22 Jun 2012 13:24:07 +0000 (13:24 +0000)]
Fix a FIXME: DwarfRequiresRelocationForSectionOffset is the same as
DwarfUsesRelocationsAcrossSections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158992 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert commit 158979 (dyatkovskiy) since it is causing several buildbots to
Duncan Sands [Fri, 22 Jun 2012 10:35:06 +0000 (10:35 +0000)]
Revert commit 158979 (dyatkovskiy) since it is causing several buildbots to
fail.  Original commit message:

Performance optimizations:
- SwitchInst: case values stored separately from Operands List. It allows to make faster access to individual case value numbers or ranges.
- Optimized IntItem, added APInt value caching.
- Optimized IntegersSubsetGeneric: added optimizations for cases when subset is single number or when subset consists from single numbers only.

On my machine these optimizations gave about 4-6% of compile-time improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158986 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPerformance optimizations:
Stepan Dyatkovskiy [Fri, 22 Jun 2012 07:35:13 +0000 (07:35 +0000)]
Performance optimizations:
- SwitchInst: case values stored separately from Operands List. It allows to make faster access to individual case value numbers or ranges.
- Optimized IntItem, added APInt value caching.
- Optimized IntegersSubsetGeneric: added optimizations for cases when subset is single number or when subset consists from single numbers only.

On my machine these optimizations gave about 4-6% of compile-time improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158979 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse "NoItineraries" for processors with no itineraries.
Andrew Trick [Fri, 22 Jun 2012 03:58:51 +0000 (03:58 +0000)]
Use "NoItineraries" for processors with no itineraries.

This makes it explicit when ScoreboardHazardRecognizer will be used.
"GenericItineraries" would only make sense if it contained real
itinerary values and still required ScoreboardHazardRecognizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158963 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFunctions calling __builtin_eh_return must have a frame pointer.
Jakob Stoklund Olesen [Fri, 22 Jun 2012 03:04:27 +0000 (03:04 +0000)]
Functions calling __builtin_eh_return must have a frame pointer.

The code in X86TargetLowering::LowerEH_RETURN() assumes that a frame
pointer exists, but the frame pointer was forced by the presence of
llvm.eh.unwind.init which isn't guaranteed.

If llvm.eh.unwind.init is actually required in functions calling
eh.return (is it?), we should diagnose that instead of emitting bad
machine code.

This should fix the dragonegg-x86_64-linux-gcc-4.6-test bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158961 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM scheduling fix: don't guess at implicit operand latency.
Andrew Trick [Fri, 22 Jun 2012 02:50:33 +0000 (02:50 +0000)]
ARM scheduling fix: don't guess at implicit operand latency.

This is a minor drive-by fix with no robust way to unit test.
As an example see neon-div.ll:
SU(16):   %Q8<def> = VMOVLsv4i32 %D17, pred:14, pred:%noreg, %Q8<imp-use,kill>
 val SU(1): Latency=2 Reg=%Q8
...should be latency=1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158960 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM scheduling fix: compute predicated implicit use properly.
Andrew Trick [Fri, 22 Jun 2012 02:50:31 +0000 (02:50 +0000)]
ARM scheduling fix: compute predicated implicit use properly.

Minor drive by fix to cleanup latency computation. Calling
getOperandLatency with a deliberately incorrect operand index does not
give you the latency you want.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158959 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEmit relocations for DW_AT_location entries on systems which need it. This is
Nick Lewycky [Fri, 22 Jun 2012 01:25:12 +0000 (01:25 +0000)]
Emit relocations for DW_AT_location entries on systems which need it. This is
a recommit of r127757. Fixes PR9493. Patch by Paul Robinson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158957 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename -allow-excess-fp-precision flag to -fuse-fp-ops, and switch from a
Lang Hames [Fri, 22 Jun 2012 01:09:09 +0000 (01:09 +0000)]
Rename -allow-excess-fp-precision flag to -fuse-fp-ops, and switch from a
boolean flag to an enum: { Fast, Standard, Strict } (default = Standard).

This option controls the creation by optimizations of fused FP ops that store
intermediate results in higher precision than IEEE allows (E.g. FMAs). The
behavior of this option is intended to match the behaviour specified by a
soon-to-be-introduced frontend flag: '-ffuse-fp-ops'.

Fast mode - allows formation of fused FP ops whenever they're profitable.

Standard mode - allow fusion only for 'blessed' FP ops. At present the only
blessed op is the fmuladd intrinsic. In the future more blessed ops may be
added.

Strict mode - allow fusion only if/when it can be proven that the excess
precision won't effect the result.

Note: This option only controls formation of fused ops by the optimizers.  Fused
operations that are explicitly requested (e.g. FMA via the llvm.fma.* intrinsic)
will always be honored, regardless of the value of this option.

Internally TargetOptions::AllowExcessFPPrecision has been replaced by
TargetOptions::AllowFPOpFusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158956 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert the PPC backend to use the new FMA infrastructure.
Hal Finkel [Fri, 22 Jun 2012 00:49:52 +0000 (00:49 +0000)]
Convert the PPC backend to use the new FMA infrastructure.

The existing contraction patterns are replaced with fma/fneg.
Overall functionality should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158955 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix whitespace in my last commit.
Nuno Lopes [Fri, 22 Jun 2012 00:29:58 +0000 (00:29 +0000)]
fix whitespace in my last commit.
sorry for the churn :S  enough for today; going to sleep.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158953 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoremove extractMallocCallFromBitCast, since it was tailor maded for its sole user...
Nuno Lopes [Fri, 22 Jun 2012 00:25:01 +0000 (00:25 +0000)]
remove extractMallocCallFromBitCast, since it was tailor maded for its sole user. Update GlobalOpt accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158952 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoinstcombine: disable optimization of 'invoke null/undef'. I'll move this functionali...
Nuno Lopes [Thu, 21 Jun 2012 23:52:14 +0000 (23:52 +0000)]
instcombine:  disable optimization of 'invoke null/undef'. I'll move this functionality to SimplifyCFG (since we cannot make changes to the CFG here).
Fixes the crashes with the attached test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158951 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[docs] Sphinxify GettingStartedVS. Patch by Mikael Lyngvig!
Michael J. Spencer [Thu, 21 Jun 2012 23:27:09 +0000 (23:27 +0000)]
[docs] Sphinxify GettingStartedVS. Patch by Mikael Lyngvig!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158947 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLook pass zext to strength reduce an udiv. Patch by David Majnemer. rdar://11721329
Evan Cheng [Thu, 21 Jun 2012 22:52:49 +0000 (22:52 +0000)]
Look pass zext to strength reduce an udiv. Patch by David Majnemer. rdar://11721329

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158946 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove trailing whitespaces
Arnaud A. de Grandmaison [Thu, 21 Jun 2012 22:26:01 +0000 (22:26 +0000)]
Remove trailing whitespaces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158943 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/unittests: Simplify LINK_COMPONENTS.
NAKAMURA Takumi [Thu, 21 Jun 2012 22:17:51 +0000 (22:17 +0000)]
llvm/unittests: Simplify LINK_COMPONENTS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158942 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.
NAKAMURA Takumi [Thu, 21 Jun 2012 22:17:39 +0000 (22:17 +0000)]
llvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158941 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe inline asm operand modifier 'n' is suppose
Jack Carter [Thu, 21 Jun 2012 21:37:54 +0000 (21:37 +0000)]
The inline asm operand modifier 'n' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Negate the immediate constant

Several Architectures such as x86 have local implementations
of operand modifier 'n' which go beyond the above description
slightly. This won't affect them.

Affected files:

    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'n' to the switch cases.

    test/CodeGen/Generic/asm-large-immediate.ll
        Generic compiled test (x86 for me)

    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158939 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for invoke to the MemoryBuiltin analysid.
Nuno Lopes [Thu, 21 Jun 2012 21:25:05 +0000 (21:25 +0000)]
Add support for invoke to the MemoryBuiltin analysid.
Update comments accordingly.

Make instcombine remove useless invokes to C++'s 'new' allocation function (test attached).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158937 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago1. fix null program output after some other changes
Akira Hatanaka [Thu, 21 Jun 2012 20:39:10 +0000 (20:39 +0000)]
1. fix null program output after some other changes
2. re-enable null.ll test
3. fix some minor style violations

Patch by Reed Kotler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158935 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd Mips to the list of target architectures for the MCJIT tests.
Akira Hatanaka [Thu, 21 Jun 2012 20:23:32 +0000 (20:23 +0000)]
Add Mips to the list of target architectures for the MCJIT tests.

Patch by Reed Kotler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158933 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTreat TargetGlobalAddress as a constant for the purpose of matching pre-inc stores...
Hal Finkel [Thu, 21 Jun 2012 20:10:48 +0000 (20:10 +0000)]
Treat TargetGlobalAddress as a constant for the purpose of matching pre-inc stores on PPC.

Thanks to Tobias von Koch for pointing out this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158932 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAvoid using the recently added APPEND_STRING feature. This should
Chandler Carruth [Thu, 21 Jun 2012 18:44:24 +0000 (18:44 +0000)]
Avoid using the recently added APPEND_STRING feature. This should
restore support for CMake versions before 2.8.6 -- sorry for the
trouble!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158930 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix build in C++11 mode.
Nuno Lopes [Thu, 21 Jun 2012 18:38:26 +0000 (18:38 +0000)]
fix build in C++11 mode.
Thanks to Chandler for pointing out the problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158928 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix potential crash if DAGCombine on stores sees a half type
Pete Cooper [Thu, 21 Jun 2012 18:00:39 +0000 (18:00 +0000)]
Fix potential crash if DAGCombine on stores sees a half type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158927 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe inline asm operand modifier 'c' is suppose
Jack Carter [Thu, 21 Jun 2012 17:14:46 +0000 (17:14 +0000)]
The inline asm operand modifier 'c' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Substitute immediate value without immediate syntax

Several Architectures such as x86 have local implementations
of operand modifier 'c' which go beyond the above description
slightly. To make use of the generic modifiers without overriding
local implementation one can make a call to the base class method
for AsmPrinter::PrintAsmOperand() in the locally derived method's
"default" case in the switch statement. That way if it is already
defined locally the generic version will never get called.

This change is needed when test/CodeGen/generic/asm-large-immediate.ll
failed on a native Mips board. The test was assuming a generic
implementation was in place.

Affected files:

    lib/Target/Mips/MipsAsmPrinter.cpp:
        Changed the default case to call the base method.
    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'c' to the switch cases.
    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158925 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agomove some typedefs so that we don't polute the llvm namespace. this should appease...
Nuno Lopes [Thu, 21 Jun 2012 16:58:41 +0000 (16:58 +0000)]
move some typedefs so that we don't polute the llvm namespace. this should appease the GCC buildbots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158924 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agohopefully fix the buildbots: some tests have wrong definitions of malloc and were...
Nuno Lopes [Thu, 21 Jun 2012 16:47:58 +0000 (16:47 +0000)]
hopefully fix the buildbots:  some tests have wrong definitions of malloc and were crashing this code on 64 bits machines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158923 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoport the BoundsChecking patch to the new MemoryBuiltin API (i.e., remove most of...
Nuno Lopes [Thu, 21 Jun 2012 15:59:53 +0000 (15:59 +0000)]
port the BoundsChecking patch to the new MemoryBuiltin API (i.e., remove most of the code from here).
Remove the alloc_size.ll test until we settle on a metadata format that makes everyone happy..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158920 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agorefactor the MemoryBuiltin analysis:
Nuno Lopes [Thu, 21 Jun 2012 15:45:28 +0000 (15:45 +0000)]
refactor the MemoryBuiltin analysis:
 - provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc)
 - provide an API to compute the size and offset of an object pointed by

Move a few clients (GVN, AA, instcombine, ...) to the new API.
This implementation is a lot more aggressive than each of the custom implementations being replaced.

Patch reviewed by Nick Lewycky and Chandler Carruth, thanks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158919 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a number of threshold arguments to the SRA pass.
Nadav Rotem [Thu, 21 Jun 2012 13:44:31 +0000 (13:44 +0000)]
Add a number of threshold arguments to the SRA pass.

A patch by Tom Stellard with minor changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158918 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since...
NAKAMURA Takumi [Thu, 21 Jun 2012 13:43:06 +0000 (13:43 +0000)]
Revert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911."

It passes according to ppc changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158917 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.
NAKAMURA Takumi [Thu, 21 Jun 2012 12:44:58 +0000 (12:44 +0000)]
llvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158914 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a pragma to supress an MSVC warning on some of the absurd code I'm
Chandler Carruth [Thu, 21 Jun 2012 10:02:41 +0000 (10:02 +0000)]
Add a pragma to supress an MSVC warning on some of the absurd code I'm
using to test the alignment support library.

Patch from Nikola on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158912 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some missing dependencies here that I missed in my first pass
Chandler Carruth [Thu, 21 Jun 2012 10:02:40 +0000 (10:02 +0000)]
Add some missing dependencies here that I missed in my first pass
through. Also sort them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158911 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCompletely refactor the structuring of unittest CMake files to match the
Chandler Carruth [Thu, 21 Jun 2012 09:51:26 +0000 (09:51 +0000)]
Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and
sanity.

This should also restore the output tree structure of all the unit
tests, sorry for breaking that, and thanks for letting me know.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages:

- No more weird directory stripping in the unittest macro, allowing it
  to be used more readily in other projects.
- No more directory prefixes on all the source files.
- Allows correct and precise use of LLVM's per-directory dependency
  system.
- Allows use of the checking logic for source files that have not been
  added to the CMake build. This uncovered a file being skipped with
  CMake in LLVM and one in Clang's unit tests.
- Makes Specifying conditional compilation or other custom logic for JIT
  tests easier.

It did require adding the concept of an explicit 'optional' source file
to the CMake build so that the missing-file check can skip cases where
the file is *supposed* to be missing. =]

This is another chunk of refactoring the CMake build in order to make it
usable for other clients like CompilerRT / ASan / TSan.

Note that this is interdependent with a Clang CMake change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm-stress: Stabalize (by using an ordered container) and add randomness to the...
Nadav Rotem [Thu, 21 Jun 2012 08:58:15 +0000 (08:58 +0000)]
llvm-stress: Stabalize (by using an ordered container) and add randomness to the order in which loops are generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158908 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCleanup some encoding mishaps.
Bill Wendling [Thu, 21 Jun 2012 07:01:02 +0000 (07:01 +0000)]
Cleanup some encoding mishaps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158904 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSphinxify the tablegen document.
Bill Wendling [Thu, 21 Jun 2012 06:58:24 +0000 (06:58 +0000)]
Sphinxify the tablegen document.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158903 91177308-0d34-0410-b5e6-96231b3b80d8