oota-llvm.git
12 years agoValidate the return type when checking if a function is malloc.
Benjamin Kramer [Wed, 23 Nov 2011 17:58:47 +0000 (17:58 +0000)]
Validate the return type when checking if a function is malloc.

Fixes PR11426. Not sure if a test case with a "wrong" malloc would be useful.

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

12 years agoFix a crash in which a multiplication was being reported as being both negative
Duncan Sands [Wed, 23 Nov 2011 16:26:47 +0000 (16:26 +0000)]
Fix a crash in which a multiplication was being reported as being both negative
and positive: positive, because it could be directly computed to be positive;
negative, because the nsw flags means it is either negative or undefined (the
multiplication always overflowed).

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

12 years agoX86: Use btq for bit tests if the immediate can't be encoded in 32 bits.
Benjamin Kramer [Wed, 23 Nov 2011 13:54:17 +0000 (13:54 +0000)]
X86: Use btq for bit tests if the immediate can't be encoded in 32 bits.

Before:
movabsq $4294967296, %rax       ## encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00]
testq %rax, %rdi              ## encoding: [0x48,0x85,0xf8]
jne LBB0_2                  ## encoding: [0x75,A]

After:
btq $32, %rdi               ## encoding: [0x48,0x0f,0xba,0xe7,0x20]
jb LBB0_2                  ## encoding: [0x72,A]

btq is usually slower than testq because it doesn't fuse with the jump, but here we're better off
saving one register and a giant movabsq.

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

12 years agotest/CodeGen/X86/block-placement.ll: Add explicit -mtriple=i686-linux. X86 Win32...
NAKAMURA Takumi [Wed, 23 Nov 2011 12:18:22 +0000 (12:18 +0000)]
test/CodeGen/X86/block-placement.ll: Add explicit -mtriple=i686-linux. X86 Win32 CodeGen does not support EH yet.

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

12 years agoRelax an invariant that block placement was trying to assert a bit
Chandler Carruth [Wed, 23 Nov 2011 10:35:36 +0000 (10:35 +0000)]
Relax an invariant that block placement was trying to assert a bit
further. This invariant just wasn't going to work in the face of
unanalyzable branches; we need to be resillient to the phenomenon of
chains poking into a loop and poking out of a loop. In fact, we already
were, we just needed to not assert on it.

This was found during a bootstrap with block placement turned on.

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

12 years agoI added several lines in X86 code generator that allow to choose
Elena Demikhovsky [Wed, 23 Nov 2011 10:23:16 +0000 (10:23 +0000)]
I added several lines in X86 code generator that allow to choose
VSHUFPS/VSHUFPD instructions while lowering VECTOR_SHUFFLE node. I check a commuted VSHUFP mask.

The patch was reviewed by Bruno.

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

12 years agoHandle the case of a no-return invoke correctly. It actually still has
Chandler Carruth [Wed, 23 Nov 2011 08:23:54 +0000 (08:23 +0000)]
Handle the case of a no-return invoke correctly. It actually still has
successors, they just are all landing pad successors. We handle this the
same way as no successors. Comments attached for the next person to wade
through here and another lovely test case courtesy of Benjamin Kramer's
bugpoint reduction.

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

12 years agoEnable stack protectors for all arrays, not just char arrays. rdar://5875909
Bob Wilson [Wed, 23 Nov 2011 07:13:56 +0000 (07:13 +0000)]
Enable stack protectors for all arrays, not just char arrays. rdar://5875909
Patch by Bill Wendling.

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

12 years agoFix PR11422.
Jakob Stoklund Olesen [Wed, 23 Nov 2011 04:03:08 +0000 (04:03 +0000)]
Fix PR11422.

This was a bug in keeping track of the available domains when merging
domain values.

The wrong domain mask caused ExecutionDepsFix to try to move VANDPSYrr
to the integer domain which is only available in AVX2.

Also add an assertion to catch future attempts at emitting AVX2
instructions.

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

12 years agoPoint to libLTO with -L/PATH/ -lLTO so that it is found in the install
Rafael Espindola [Wed, 23 Nov 2011 03:07:25 +0000 (03:07 +0000)]
Point to libLTO with -L/PATH/ -lLTO so that it is found in the install
directory.
Patch by Markus Trippelsdorf.

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

12 years agoFix a crash in block placement due to an inner loop that happened to be
Chandler Carruth [Wed, 23 Nov 2011 03:03:21 +0000 (03:03 +0000)]
Fix a crash in block placement due to an inner loop that happened to be
reversed in the function's original ordering, and we happened to
encounter it while handling an outer unnatural CFG structure.

Thanks to the test case reduced from GCC's source by Benjamin Kramer.
This may also fix a crasher in gzip that Duncan reduced for me, but
I haven't yet gotten to testing that one.

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

12 years ago[asan] do not instrument threadlocal globals, this is buggy
Kostya Serebryany [Wed, 23 Nov 2011 02:10:54 +0000 (02:10 +0000)]
[asan] do not instrument threadlocal globals, this is buggy

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

12 years agoUndo test commit
Anshuman Dasgupta [Tue, 22 Nov 2011 20:05:48 +0000 (20:05 +0000)]
Undo test commit

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

12 years agoTest commit
Anshuman Dasgupta [Tue, 22 Nov 2011 20:03:30 +0000 (20:03 +0000)]
Test commit

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

12 years agoadd basic PPC register-pressure feedback; adjust the vaarg test to match the new...
Hal Finkel [Tue, 22 Nov 2011 16:21:04 +0000 (16:21 +0000)]
add basic PPC register-pressure feedback; adjust the vaarg test to match the new register-allocation pattern

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

12 years agoMore fixes to the X86InstComments for shuffle instructions. In particular add AVX...
Craig Topper [Tue, 22 Nov 2011 14:27:57 +0000 (14:27 +0000)]
More fixes to the X86InstComments for shuffle instructions. In particular add AVX flavors of many instructions and fix the destination operand for some of the existing AVX entries.

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

12 years agoFix a devilish miscompile exposed by block placement. The
Chandler Carruth [Tue, 22 Nov 2011 13:13:16 +0000 (13:13 +0000)]
Fix a devilish miscompile exposed by block placement. The
updateTerminator code didn't correctly handle EH terminators in one very
specific case. AnalyzeBranch would find no terminator instruction, and
so the fallback in updateTerminator is to assume fallthrough. This is
correct, but the destination of the fallthrough was assumed to be the
first successor.

This is *almost always* true, but in certain cases the loop
transformations will cause the landing pad to be the first successor!
Instead of this brittle logic, actually look through the successors for
a non-landing-pad accessor, and to assert if more than one is found.

This will hopefully fix some (if not all) of the self host miscompiles
with block placement. Thanks to Benjamin Kramer for reporting, Nick
Lewycky for an initial stab at a reduction, and Duncan for endless
advice on EH (which I know nothing about) as well as reviewing the
actual fix.

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

12 years agoAdd configure checking for pread(2) and use it to save a syscall when reading files.
Benjamin Kramer [Tue, 22 Nov 2011 12:31:53 +0000 (12:31 +0000)]
Add configure checking for pread(2) and use it to save a syscall when reading files.

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

12 years agoFix an obvious omission in the SelectionDAGBuilder where we were
Chandler Carruth [Tue, 22 Nov 2011 11:37:46 +0000 (11:37 +0000)]
Fix an obvious omission in the SelectionDAGBuilder where we were
dropping weights on the floor for invokes. This was impeding my writing
further test cases for invoke when interacting with probabilities and
block placement.

No test case as there doesn't appear to be a way to test this stuff. =/
Suggestions for a test case of course welcome. I hope to be able to add
test cases that indirectly cover this eventually by adding probabilities
to the exceptional edge and reordering blocks as a result.

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

12 years agoTurn error recovery into an assert.
Benjamin Kramer [Tue, 22 Nov 2011 11:37:11 +0000 (11:37 +0000)]
Turn error recovery into an assert.

This was put in because in a certain version of DragonFlyBSD stat(2) lied about the
size of some files. This was fixed a long time ago so we can remove the workaround.

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

12 years agoAdd triple to the test.
Rafael Espindola [Tue, 22 Nov 2011 06:36:25 +0000 (06:36 +0000)]
Add triple to the test.

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

12 years agoIf a register is both an early clobber and part of a tied use, handle the use
Rafael Espindola [Tue, 22 Nov 2011 06:27:18 +0000 (06:27 +0000)]
If a register is both an early clobber and part of a tied use, handle the use
before the clobber so that we copy the value if needed.

Fixes pr11415.

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

12 years agoFix shuffle decoding logic to handle UNPCKLPS/UNPCKLPD on 256-bit vectors correctly...
Craig Topper [Tue, 22 Nov 2011 01:57:35 +0000 (01:57 +0000)]
Fix shuffle decoding logic to handle UNPCKLPS/UNPCKLPD on 256-bit vectors correctly. Add support for decoding UNPCKHPS/UNPCKHPD for AVX 128-bit and 256-bit forms.

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

12 years agoAdd methods for querying minimum SSE version along with AVX. Simplifies all the place...
Craig Topper [Tue, 22 Nov 2011 00:44:41 +0000 (00:44 +0000)]
Add methods for querying minimum SSE version along with AVX. Simplifies all the places that had to check a version of SSE and AVX.

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

12 years agofix typo in comment
Sebastian Pop [Mon, 21 Nov 2011 20:46:55 +0000 (20:46 +0000)]
fix typo in comment

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

12 years agoFix crasher in GVN due to my recent capture tracking changes.
Nick Lewycky [Mon, 21 Nov 2011 19:42:56 +0000 (19:42 +0000)]
Fix crasher in GVN due to my recent capture tracking changes.

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

12 years agoAdd virtual destructor. Whoops!
Nick Lewycky [Mon, 21 Nov 2011 18:32:21 +0000 (18:32 +0000)]
Add virtual destructor. Whoops!

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

12 years agoLowering for v32i8 to VPUNPCKLBW/VPUNPCKHBW when AVX2 is enabled.
Craig Topper [Mon, 21 Nov 2011 08:26:50 +0000 (08:26 +0000)]
Lowering for v32i8 to VPUNPCKLBW/VPUNPCKHBW when AVX2 is enabled.

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

12 years agoTest case for r145026
Craig Topper [Mon, 21 Nov 2011 06:58:09 +0000 (06:58 +0000)]
Test case for r145026

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

12 years agoAdd support for lowering 256-bit shuffles to VPUNPCKL/H for i16, i32, i64 if AVX2...
Craig Topper [Mon, 21 Nov 2011 06:57:39 +0000 (06:57 +0000)]
Add support for lowering 256-bit shuffles to VPUNPCKL/H for i16, i32, i64 if AVX2 is enabled.

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

12 years agoFixing a comment
Joe Abbey [Mon, 21 Nov 2011 04:42:21 +0000 (04:42 +0000)]
Fixing a comment

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

12 years agoMake LowerSIGN_EXTEND_INREG split 256-bit vectors when AVX1 is enabled and use AVX2...
Craig Topper [Mon, 21 Nov 2011 01:12:36 +0000 (01:12 +0000)]
Make LowerSIGN_EXTEND_INREG split 256-bit vectors when AVX1 is enabled and use AVX2 shifts when AVX2 is enabled.

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

12 years agoLess template, more virtual! Refactoring suggested by Chris in code review.
Nick Lewycky [Sun, 20 Nov 2011 19:37:06 +0000 (19:37 +0000)]
Less template, more virtual! Refactoring suggested by Chris in code review.

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

12 years agoRefactor code to use new attribute getters on CallSite for NoCapture and ByVal.
Nick Lewycky [Sun, 20 Nov 2011 19:09:04 +0000 (19:09 +0000)]
Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.
Suggested in code review by Eli.

That code in InstCombine looks kinda suspicious.

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

12 years agotest/CodeGen/X86/block-placement.ll: Relax expressions for Win32.
NAKAMURA Takumi [Sun, 20 Nov 2011 12:49:45 +0000 (12:49 +0000)]
test/CodeGen/X86/block-placement.ll: Relax expressions for Win32.

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

12 years agoThe logic for breaking the CFG in the presence of hot successors didn't
Chandler Carruth [Sun, 20 Nov 2011 11:22:06 +0000 (11:22 +0000)]
The logic for breaking the CFG in the presence of hot successors didn't
properly account for the *global* probability of the edge being taken.
This manifested as a very large number of unconditional branches to
blocks being merged against the CFG even though they weren't
particularly hot within the CFG.

The fix is to check whether the edge being merged is both locally hot
relative to other successors for the source block, and globally hot
compared to other (unmerged) predecessors of the destination block.

This introduces a new crasher on GCC single-source, but it's currently
behind a flag, and Ben has offered to work on the reduction. =]

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

12 years agoMake an obviously const interface actually be marked as const.
Chandler Carruth [Sun, 20 Nov 2011 11:22:03 +0000 (11:22 +0000)]
Make an obviously const interface actually be marked as const.

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

12 years agoXFAIL this test until I figure out what indvars is doing here (or find someone who...
Benjamin Kramer [Sun, 20 Nov 2011 11:10:03 +0000 (11:10 +0000)]
XFAIL this test until I figure out what indvars is doing here (or find someone who does)

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

12 years agoSCEV: Actually set overflow flags on add expressions.
Benjamin Kramer [Sun, 20 Nov 2011 10:24:36 +0000 (10:24 +0000)]
SCEV: Actually set overflow flags on add expressions.

setFlags doesn't modify its arguments.

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

12 years agoAdd some comments to the latest test case I added here to document what
Chandler Carruth [Sun, 20 Nov 2011 09:30:40 +0000 (09:30 +0000)]
Add some comments to the latest test case I added here to document what
is actually being tested. Also add some FileCheck goodness to much more
carefully ensure that the result is the desired result. Before this test
would only have failed through an assert failure if the underlying fix
were reverted.

Also, add some weight metadata and a comment explaining exactly what is
going on to a trick section of the test case. Originally, we were
getting very unlucky and trying to form a block chain that isn't
actually profitable. I'm working on a fix to avoid forming these
unprofitable chains, and that would also have masked any failure from
this test case. The easy solution is to add some metadata that makes it
*really* profitable to form the bad chain here.

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

12 years agoAdd code for lowering v32i8 shifts by a splat to AVX2 immediate shift instructions...
Craig Topper [Sun, 20 Nov 2011 00:12:05 +0000 (00:12 +0000)]
Add code for lowering v32i8 shifts by a splat to AVX2 immediate shift instructions. Remove 256-bit splat handling from LowerShift as it was already handled by PerformShiftCombine.

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

12 years agoUse 256-bit vcmpeqd for creating an all ones vector when AVX2 is enabled.
Craig Topper [Sat, 19 Nov 2011 22:34:59 +0000 (22:34 +0000)]
Use 256-bit vcmpeqd for creating an all ones vector when AVX2 is enabled.

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

12 years agoRemove some of the special classes that worked around an old tablegen limitation...
Craig Topper [Sat, 19 Nov 2011 21:01:54 +0000 (21:01 +0000)]
Remove some of the special classes that worked around an old tablegen limitation of not being able to remove redundant bitconverts from patterns.

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

12 years agoCustom lower AVX2 variable shift intrinsics to shl/srl/sra nodes and remove the intri...
Craig Topper [Sat, 19 Nov 2011 17:46:46 +0000 (17:46 +0000)]
Custom lower AVX2 variable shift intrinsics to shl/srl/sra nodes and remove the intrinsic patterns.

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

12 years agoMove the handling of unanalyzable branches out of the loop-driven chain
Chandler Carruth [Sat, 19 Nov 2011 10:26:02 +0000 (10:26 +0000)]
Move the handling of unanalyzable branches out of the loop-driven chain
formation phase and into the initial walk of the basic blocks. We
essentially pre-merge all blocks where unanalyzable fallthrough exists,
as we won't be able to update the terminators effectively after any
reorderings. This is quite a bit more principled as there may be CFGs
where the second half of the unanalyzable pair has some analyzable
predecessor that gets placed first. Then it may get placed next,
implicitly breaking the unanalyzable branch even though we never even
looked at the part that isn't analyzable. I've included a test case that
triggers this (thanks Benjamin yet again!), and I'm hoping to synthesize
some more general ones as I dig into related issues.

Also, to make this new scheme work we have to be able to handle branches
into the middle of a chain, so add this check. We always fallback on the
incoming ordering.

Finally, this starts to really underscore a known limitation of the
current implementation -- we don't consider broken predecessors when
merging successors. This can caused major missed opportunities, and is
something I'm planning on looking at next (modulo more bug reports).

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

12 years agoTest cases for SSSE3/AVX integer horizontal add/sub.
Craig Topper [Sat, 19 Nov 2011 09:03:33 +0000 (09:03 +0000)]
Test cases for SSSE3/AVX integer horizontal add/sub.

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

12 years agoSynthesize SSSE3/AVX 128-bit horizontal integer add/sub instructions from add/sub...
Craig Topper [Sat, 19 Nov 2011 09:02:40 +0000 (09:02 +0000)]
Synthesize SSSE3/AVX 128-bit horizontal integer add/sub instructions from add/sub of appropriate shuffle vectors.

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

12 years agoCollapse X86 PSIGNB/PSIGNW/PSIGND node types.
Craig Topper [Sat, 19 Nov 2011 07:33:10 +0000 (07:33 +0000)]
Collapse X86 PSIGNB/PSIGNW/PSIGND node types.

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

12 years agoExtend VPBLENDVB and VPSIGN lowering to work for AVX2.
Craig Topper [Sat, 19 Nov 2011 07:07:26 +0000 (07:07 +0000)]
Extend VPBLENDVB and VPSIGN lowering to work for AVX2.

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

12 years agoRemove some unnecessary filtering checks from X86 disassembler table build.
Craig Topper [Sat, 19 Nov 2011 05:48:20 +0000 (05:48 +0000)]
Remove some unnecessary filtering checks from X86 disassembler table build.

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

12 years agoRemove unused parameters from the AVX maskmov classes.
Craig Topper [Sat, 19 Nov 2011 04:49:22 +0000 (04:49 +0000)]
Remove unused parameters from the AVX maskmov classes.

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

12 years agoFix a corner case in updating LoopInfo after fully unrolling an outer loop.
Andrew Trick [Fri, 18 Nov 2011 03:42:41 +0000 (03:42 +0000)]
Fix a corner case in updating LoopInfo after fully unrolling an outer loop.

The loop tree's inclusive block lists are painful and expensive to
update. (I have no idea why they're inclusive). The design was
supposed to handle this case but the implementation missed it and my
unit tests weren't thorough enough.

Fixes PR11335: loop unroll update.

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

12 years agoAdd AVX2 vpbroadcast support
Nadav Rotem [Fri, 18 Nov 2011 02:49:55 +0000 (02:49 +0000)]
Add AVX2 vpbroadcast support

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

12 years ago[asan] workaround for reg alloc bug 11395: don't instrument functions with large...
Kostya Serebryany [Fri, 18 Nov 2011 01:41:06 +0000 (01:41 +0000)]
[asan] workaround for reg alloc bug 11395: don't instrument functions with large chunks of inline assembler

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

12 years agoGuard call to getRegForValue with isTypeLegal check to avoid unnecessary work/dead...
Chad Rosier [Fri, 18 Nov 2011 01:17:34 +0000 (01:17 +0000)]
Guard call to getRegForValue with isTypeLegal check to avoid unnecessary work/dead code.

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

12 years agoDISubrange supports unsigned lower/upper array bounds, so let's not fake it in the...
Devang Patel [Thu, 17 Nov 2011 23:43:15 +0000 (23:43 +0000)]
DISubrange supports unsigned lower/upper array bounds, so let's not fake it in the end while emitting DWARF. If a FE needs to encode signed lower/upper array bounds then we need to extend DISubrange or ad DISignedSubrange.

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

12 years agoquick fix: remove GlobalVariable::GlobalVariable mistakenly commited at r144933....
Kostya Serebryany [Thu, 17 Nov 2011 23:37:53 +0000 (23:37 +0000)]
quick fix: remove GlobalVariable::GlobalVariable mistakenly commited at r144933. For some reason this compiles on linux

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

12 years agoFix an overly general check in SimplifyIndvar to handle useless phi cycles.
Andrew Trick [Thu, 17 Nov 2011 23:36:35 +0000 (23:36 +0000)]
Fix an overly general check in SimplifyIndvar to handle useless phi cycles.

The right way to check for a binary operation is
cast<BinaryOperator>. The original check: cast<Instruction> &&
numOperands() == 2 would match phi "instructions", leading to an
infinite loop in extreme corner case: a useless phi with operands
[self, constant] that prior optimization passes failed to remove,
being used in the loop by another useless phi, in turn being used by an
lshr or udiv.

Fixes PR11350: runaway iteration assertion.

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

12 years agofall back to explicit list of allowed linkages when instrumenting globals in asan...
Kostya Serebryany [Thu, 17 Nov 2011 23:14:59 +0000 (23:14 +0000)]
fall back to explicit list of allowed linkages when instrumenting globals in asan; add a test check that asan does not touch linkonce_odr

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

12 years agoFix bug in RefCountedBase/RefCountedBaseVPTR where the reference count was accidental...
Ted Kremenek [Thu, 17 Nov 2011 23:02:14 +0000 (23:02 +0000)]
Fix bug in RefCountedBase/RefCountedBaseVPTR where the reference count was accidentally copied as part of the copy constructor.  This could result in objects getting leaked because there reference count was too high.

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

12 years agoAdd TODO comment.
Chad Rosier [Thu, 17 Nov 2011 21:46:13 +0000 (21:46 +0000)]
Add TODO comment.

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

12 years agoFix SSE/AVX integer comparison patterns to understand that all integer vector loads...
Craig Topper [Thu, 17 Nov 2011 07:49:38 +0000 (07:49 +0000)]
Fix SSE/AVX integer comparison patterns to understand that all integer vector loads are promoted to i64 vector loads so patterns need a bitconvert. Also slightly simplify the AVX2 variable shift patterns by using the predefined bitconvert pattern fragments.

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

12 years agoDead code.
Chad Rosier [Thu, 17 Nov 2011 07:24:49 +0000 (07:24 +0000)]
Dead code.

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

12 years agoWhen fast iseling a GEP, accumulate the offset rather than emitting a series of
Chad Rosier [Thu, 17 Nov 2011 07:15:58 +0000 (07:15 +0000)]
When fast iseling a GEP, accumulate the offset rather than emitting a series of
ADDs.  MaxOffs is used as a threshold to limit the size of the offset. Tradeoffs
being: (1) If we can't materialize the large constant then we'll cause fast-isel
to bail. (2) Too large of an offset can't be directly encoded in the ADD
resulting in a MOV+ADD.  Generally not a bad thing because otherwise we would
have had ADD+ADD, but on Thumb this turns into a MOVS+MOVT+ADD. Working on a fix
for that. (3) Conversely, too low of a threshold we'll miss opportunities to
coalesce ADDs.
rdar://10412592

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

12 years agoRemove seemingly unnecessary duplicate VROUND definitions.
Craig Topper [Thu, 17 Nov 2011 07:04:00 +0000 (07:04 +0000)]
Remove seemingly unnecessary duplicate VROUND definitions.

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

12 years agox86/windows issues fixed.
Chris Lattner [Thu, 17 Nov 2011 01:42:23 +0000 (01:42 +0000)]
x86/windows issues fixed.

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

12 years agoAdd support for custom names for library functions in TargetLibraryInfo. Add a custo...
Eli Friedman [Thu, 17 Nov 2011 01:27:36 +0000 (01:27 +0000)]
Add support for custom names for library functions in TargetLibraryInfo.  Add a custom name for fwrite and fputs on x86-32 OSX.  Make SimplifyLibCalls honor the custom
names for fwrite and fputs.

Fixes <rdar://problem/9815881>.

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

12 years agollvm-build: Attempt to work around a CMake Makefile generator bug that doesn't
Daniel Dunbar [Thu, 17 Nov 2011 01:19:53 +0000 (01:19 +0000)]
llvm-build: Attempt to work around a CMake Makefile generator bug that doesn't
properly quote strings when writing the CMakeFiles/Makefile.cmake output file
(which lists the dependencies). This shows up when using CMake + MSYS Makefile
generator.

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

12 years agoDon't unconditionally set the kill flag.
Chad Rosier [Thu, 17 Nov 2011 01:16:53 +0000 (01:16 +0000)]
Don't unconditionally set the kill flag.
rdar://10456186

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

12 years agoTurn on vzeroupper insertion on call boundaries for AVX; it works as far as I know...
Eli Friedman [Thu, 17 Nov 2011 00:21:52 +0000 (00:21 +0000)]
Turn on vzeroupper insertion on call boundaries for AVX; it works as far as I know, and I'd like to see wider testing.

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

12 years agobuild/make/test: Get rid of unused BUGPOINT_TOPTS variable.
Daniel Dunbar [Wed, 16 Nov 2011 23:56:03 +0000 (23:56 +0000)]
build/make/test: Get rid of unused BUGPOINT_TOPTS variable.

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

12 years agoMake sure to replace the chain properly when DAGCombining a LOAD+EXTRACT_VECTOR_ELT...
Eli Friedman [Wed, 16 Nov 2011 23:50:22 +0000 (23:50 +0000)]
Make sure to replace the chain properly when DAGCombining a LOAD+EXTRACT_VECTOR_ELT into a single LOAD.  Fixes PR10747/PR11393.

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

12 years agoObject/COFF: Support common symbols.
Michael J. Spencer [Wed, 16 Nov 2011 23:36:12 +0000 (23:36 +0000)]
Object/COFF: Support common symbols.

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

12 years agoRemove obsolete test.
Jim Grosbach [Wed, 16 Nov 2011 22:50:38 +0000 (22:50 +0000)]
Remove obsolete test.

The PLD encoding is checked via the .s file now.

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

12 years agoGeneralize the fixup info for ARM mode.
Jim Grosbach [Wed, 16 Nov 2011 22:48:37 +0000 (22:48 +0000)]
Generalize the fixup info for ARM mode.

We don't (yet) have the granularity in the fixups to be specific about which
bitranges are affected. That's a future cleanup, but we're not there yet.

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

12 years agoUpdate test for r144842.
Jim Grosbach [Wed, 16 Nov 2011 22:46:27 +0000 (22:46 +0000)]
Update test for r144842.

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

12 years agoLower 64-bit constant pool node.
Akira Hatanaka [Wed, 16 Nov 2011 22:44:38 +0000 (22:44 +0000)]
Lower 64-bit constant pool node.

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

12 years agoLower 64-bit block address.
Akira Hatanaka [Wed, 16 Nov 2011 22:42:10 +0000 (22:42 +0000)]
Lower 64-bit block address.

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

12 years agoFix encoding of NOP used for padding in ARM mode .align.
Jim Grosbach [Wed, 16 Nov 2011 22:40:25 +0000 (22:40 +0000)]
Fix encoding of NOP used for padding in ARM mode .align.

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

12 years agoAdd patterns for 64-bit tglobaladdr, tblockaddress, tjumptable and tconstpool
Akira Hatanaka [Wed, 16 Nov 2011 22:39:56 +0000 (22:39 +0000)]
Add patterns for 64-bit tglobaladdr, tblockaddress, tjumptable and tconstpool
nodes.

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

12 years ago64-bit jump register instruction.
Akira Hatanaka [Wed, 16 Nov 2011 22:36:01 +0000 (22:36 +0000)]
64-bit jump register instruction.

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

12 years agoAnother missing X86ISD::MOVLPD pattern. rdar://10450317
Evan Cheng [Wed, 16 Nov 2011 22:24:44 +0000 (22:24 +0000)]
Another missing X86ISD::MOVLPD pattern. rdar://10450317

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

12 years agoARM assembly parsing for shifted register operands for MOV instruction.
Jim Grosbach [Wed, 16 Nov 2011 21:50:05 +0000 (21:50 +0000)]
ARM assembly parsing for shifted register operands for MOV instruction.

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

12 years agoClean up debug printing of ARM shifted operands.
Jim Grosbach [Wed, 16 Nov 2011 21:46:50 +0000 (21:46 +0000)]
Clean up debug printing of ARM shifted operands.

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

12 years agoAdd fast-isel stats to determine who's doing all the work, the
Chad Rosier [Wed, 16 Nov 2011 21:05:28 +0000 (21:05 +0000)]
Add fast-isel stats to determine who's doing all the work, the
target-independent selector or the target-specific selector.

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

12 years agoFix the stats collection for fast-isel. The failed count was only accounting
Chad Rosier [Wed, 16 Nov 2011 21:02:08 +0000 (21:02 +0000)]
Fix the stats collection for fast-isel.  The failed count was only accounting
for a single miss and not all predecessor instructions that get selected by
the selection DAG instruction selector.  This is still not exact (e.g., over
states misses when folded/dead instructions are present), but it is a step in
the right direction.

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

12 years agoThere are already problems with building LLVM under VS2005, and it's
Chandler Carruth [Wed, 16 Nov 2011 19:52:13 +0000 (19:52 +0000)]
There are already problems with building LLVM under VS2005, and it's
quite old now. Update the documentation to reflect this, and direct
people to use VS2008 or newer.

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

12 years agoARM assmebly two operand forms for LSR, ASR, LSL, ROR register.
Jim Grosbach [Wed, 16 Nov 2011 19:12:24 +0000 (19:12 +0000)]
ARM assmebly two operand forms for LSR, ASR, LSL, ROR register.

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

12 years agoARM assembly parsing for RRX mnemonic.
Jim Grosbach [Wed, 16 Nov 2011 19:05:59 +0000 (19:05 +0000)]
ARM assembly parsing for RRX mnemonic.

rdar://9704684

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

12 years agoAdded missing comment about new custom lowering of DEC64
Pete Cooper [Wed, 16 Nov 2011 19:03:23 +0000 (19:03 +0000)]
Added missing comment about new custom lowering of DEC64

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

13 years agoDisable expensive two-address optimizations at -O0. rdar://10453055
Evan Cheng [Wed, 16 Nov 2011 18:44:48 +0000 (18:44 +0000)]
Disable expensive two-address optimizations at -O0. rdar://10453055

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

13 years agoCheck to make sure we can select the instruction before trying to put the
Chad Rosier [Wed, 16 Nov 2011 18:39:44 +0000 (18:39 +0000)]
Check to make sure we can select the instruction before trying to put the
operands into a register.  Otherwise, we may materialize dead code.

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

13 years agoDisable the assertion again. Looks like fastisel is still generating bad kill markers.
Evan Cheng [Wed, 16 Nov 2011 18:32:14 +0000 (18:32 +0000)]
Disable the assertion again. Looks like fastisel is still generating bad kill markers.

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

13 years agoARM mode aliases for bitwise instructions w/ register operands.
Jim Grosbach [Wed, 16 Nov 2011 18:31:45 +0000 (18:31 +0000)]
ARM mode aliases for bitwise instructions w/ register operands.

rdar://9704684

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

13 years agoFix tablegen warning: hasSideEffects is inferred for eh_sjlj_dispatchsetup.
Bob Wilson [Wed, 16 Nov 2011 17:09:59 +0000 (17:09 +0000)]
Fix tablegen warning: hasSideEffects is inferred for eh_sjlj_dispatchsetup.

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

13 years agolib/Target/ARM/CMakeLists.txt: Disable optimization in ARMISelLowering.cpp also on...
NAKAMURA Takumi [Wed, 16 Nov 2011 09:18:28 +0000 (09:18 +0000)]
lib/Target/ARM/CMakeLists.txt: Disable optimization in ARMISelLowering.cpp also on MSC15(aka VS9). Seems miscompiled.

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

13 years agoSink codegen optimization level into MCCodeGenInfo along side relocation model
Evan Cheng [Wed, 16 Nov 2011 08:38:26 +0000 (08:38 +0000)]
Sink codegen optimization level into MCCodeGenInfo along side relocation model
and code model. This eliminates the need to pass OptLevel flag all over the
place and makes it possible for any codegen pass to use this information.

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

13 years agoRecord landing pads with a SmallSetVector to avoid multiple entries.
Bob Wilson [Wed, 16 Nov 2011 07:57:21 +0000 (07:57 +0000)]
Record landing pads with a SmallSetVector to avoid multiple entries.

There may be many invokes that share one landing pad, and the previous code
would record the landing pad once for each invoke.  Besides the wasted
effort, a pair of volatile loads gets inserted every time the landing pad is
processed.  The rest of the code can get optimized away when a landing pad
is processed repeatedly, but the volatile loads remain, resulting in code like:

LBB35_18:
Ltmp483:
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r2, [r7, #-72]
        ldr     r2, [r7, #-68]
        ldr     r4, [r7, #-72]
        ldr     r2, [r7, #-68]

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

13 years agoFix the execution domain on a bunch of SSE/AVX instructions.
Craig Topper [Wed, 16 Nov 2011 07:30:46 +0000 (07:30 +0000)]
Fix the execution domain on a bunch of SSE/AVX instructions.

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

13 years agoUpdate the SP in the SjLj jmpbuf whenever it changes. <rdar://problem/10444602>
Bob Wilson [Wed, 16 Nov 2011 07:12:00 +0000 (07:12 +0000)]
Update the SP in the SjLj jmpbuf whenever it changes.  <rdar://problem/10444602>

This same basic code was in the older version of the SjLj exception handling,
but it was removed in the recent revisions to that code.  It needs to be there.

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