oota-llvm.git
13 years agocrc32 with 64-bit output zeros upper 32-bits. rdar://9467055
Evan Cheng [Thu, 19 May 2011 18:57:12 +0000 (18:57 +0000)]
crc32 with 64-bit output zeros upper 32-bits. rdar://9467055

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

13 years agoUpdate some currently-disabled code, preparing for eventual use.
Stuart Hastings [Thu, 19 May 2011 18:48:20 +0000 (18:48 +0000)]
Update some currently-disabled code, preparing for eventual use.

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

13 years agoIncrease number of available registers when target is MIPS32.
Akira Hatanaka [Thu, 19 May 2011 18:25:03 +0000 (18:25 +0000)]
Increase number of available registers when target is MIPS32.

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

13 years agoAdd comment.
Evan Cheng [Thu, 19 May 2011 18:18:39 +0000 (18:18 +0000)]
Add comment.

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

13 years agoSimplify CC_MipsO32 and merge it with CC_MipsO32_VarArgs. Patch by Sasa Stankovic.
Akira Hatanaka [Thu, 19 May 2011 18:06:05 +0000 (18:06 +0000)]
Simplify CC_MipsO32 and merge it with CC_MipsO32_VarArgs. Patch by Sasa Stankovic.

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

13 years agoReapply 131644 including the missing header changes:
Joerg Sonnenberger [Thu, 19 May 2011 18:00:13 +0000 (18:00 +0000)]
Reapply 131644 including the missing header changes:
Introduce -fatal-assembler-warnings for the obvious purpose

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

13 years agoReverting 131641 to investigate 'bot complaint.
Stuart Hastings [Thu, 19 May 2011 17:54:42 +0000 (17:54 +0000)]
Reverting 131641 to investigate 'bot complaint.

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

13 years agoRevert r131644; it's breaking the build.
Eli Friedman [Thu, 19 May 2011 17:48:09 +0000 (17:48 +0000)]
Revert r131644; it's breaking the build.

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

13 years agoTurns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
Charles Davis [Thu, 19 May 2011 17:46:39 +0000 (17:46 +0000)]
Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
ours compatible with GAS.

In retrospect, I should have emailed binutils about this earlier. Thanks to
Kai Tietz for pointing out that GAS already had SEH directives.

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

13 years ago80 columns.
Jim Grosbach [Thu, 19 May 2011 17:34:53 +0000 (17:34 +0000)]
80 columns.

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

13 years agoIntroduce -fatal-assembler-warnings for the obvious purpose
Joerg Sonnenberger [Thu, 19 May 2011 17:27:01 +0000 (17:27 +0000)]
Introduce -fatal-assembler-warnings for the obvious purpose

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

13 years agoFix data layout string. i64 is aligned to 64 bit boundaries.
Akira Hatanaka [Thu, 19 May 2011 17:21:09 +0000 (17:21 +0000)]
Fix data layout string. i64 is aligned to 64 bit boundaries.

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

13 years agoRevise MOVSX16rr8/MOVZX16rr8 (and rm variants) to no longer be
Stuart Hastings [Thu, 19 May 2011 16:59:50 +0000 (16:59 +0000)]
Revise MOVSX16rr8/MOVZX16rr8 (and rm variants) to no longer be
pseudos.  rdar://problem/8614450

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

13 years agoMove test to Transforms/InstCombine.
Stuart Hastings [Thu, 19 May 2011 05:53:22 +0000 (05:53 +0000)]
Move test to Transforms/InstCombine.

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

13 years agoUse the correct register class for Cell varargs spilling. This fixes all of the
Cameron Zwarich [Thu, 19 May 2011 04:44:19 +0000 (04:44 +0000)]
Use the correct register class for Cell varargs spilling. This fixes all of the
verifier failures in the CodeGen/CellSPU tests.

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

13 years agoFixed sdiv and udiv for <4 x i16>. The test from r125402 still applies for this...
Mon P Wang [Thu, 19 May 2011 04:15:07 +0000 (04:15 +0000)]
Fixed sdiv and udiv for <4 x i16>.  The test from r125402 still applies for this change.

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

13 years agoImplement the StartChained and EndChained Win64 EH methods on MCStreamer.
Charles Davis [Thu, 19 May 2011 04:04:13 +0000 (04:04 +0000)]
Implement the StartChained and EndChained Win64 EH methods on MCStreamer.

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

13 years agoMake CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll pass with the verifier.
Cameron Zwarich [Thu, 19 May 2011 03:11:06 +0000 (03:11 +0000)]
Make CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll pass with the verifier.

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

13 years agoFix PR8828 by removing the explicit def in MovePCToLR as well as the pointless
Cameron Zwarich [Thu, 19 May 2011 02:56:28 +0000 (02:56 +0000)]
Fix PR8828 by removing the explicit def in MovePCToLR as well as the pointless
piclabel operand. The operand in the tablegen definition doesn't actually turn
into an MI operand, so it just confuses anything checking the TargetInstrDesc
for the number of operands. It suffices to just have an implicit def of LR.

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

13 years agoReuse the TargetInstrDesc.
Cameron Zwarich [Thu, 19 May 2011 02:56:23 +0000 (02:56 +0000)]
Reuse the TargetInstrDesc.

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

13 years agoFix the MSVC build.
Francois Pichet [Thu, 19 May 2011 02:54:11 +0000 (02:54 +0000)]
Fix the MSVC build.
Use a set of overloaded functions instead of template function for CreatePassFn.

It seems that template deduction for functions type that differs only by return type doesn't work with MSVC.

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

13 years agoImplement the StartProc and EndProc Win64 EH methods on the base MCStreamer.
Charles Davis [Thu, 19 May 2011 02:49:00 +0000 (02:49 +0000)]
Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.

Based largely on Rafael Espindola's work on CFI. Other methods soon to follow.

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

13 years agoFix build issues with headers, which I discovered by actually using them.
Charles Davis [Thu, 19 May 2011 02:47:23 +0000 (02:47 +0000)]
Fix build issues with headers, which I discovered by actually using them.

Also, convert all the inline functions on UnwindInfo into methods.

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

13 years agoAdd test for PR9946.
Rafael Espindola [Thu, 19 May 2011 02:35:26 +0000 (02:35 +0000)]
Add test for PR9946.

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

13 years agorevert 131605 to fix PR9946.
Rafael Espindola [Thu, 19 May 2011 02:26:30 +0000 (02:26 +0000)]
revert 131605 to fix PR9946.

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

13 years agoCorrectly constrain a register class when computing frame offsets, as the Thumb2
Cameron Zwarich [Thu, 19 May 2011 02:18:27 +0000 (02:18 +0000)]
Correctly constrain a register class when computing frame offsets, as the Thumb2
add instruction takes an rGPR. This fixes the last of PR8825.

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

13 years agoRevert r128961 because it didn't include a test and causes the verifier to fail
Cameron Zwarich [Thu, 19 May 2011 01:56:19 +0000 (01:56 +0000)]
Revert r128961 because it didn't include a test and causes the verifier to fail
on CodeGen/X86/2007-05-07-InvokeSRet.ll. There is probably a bug here that was
fixed by r128961, but since there is no test or reference to a source file I have
to revert it.

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

13 years agoMake the demanded bits/elements optimizations preserve debug line information.
Eli Friedman [Thu, 19 May 2011 01:20:42 +0000 (01:20 +0000)]
Make the demanded bits/elements optimizations preserve debug line information.

I'm not sure this is quite ideal, but I can't really think of any better way to do it.

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

13 years agoAvoid a Twine that referenced a tmp (which proceded to go out of scope before
Jim Grosbach [Thu, 19 May 2011 00:45:05 +0000 (00:45 +0000)]
Avoid a Twine that referenced a tmp (which proceded to go out of scope before
the Twine was used).

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

13 years agoUse IRBuilder.
Devang Patel [Thu, 19 May 2011 00:13:33 +0000 (00:13 +0000)]
Use IRBuilder.

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

13 years agoAnother try at fixing cmake.
Rafael Espindola [Thu, 19 May 2011 00:13:04 +0000 (00:13 +0000)]
Another try at fixing cmake.

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

13 years agoUse IRBuilder while simplifying unreachable.
Devang Patel [Thu, 19 May 2011 00:09:21 +0000 (00:09 +0000)]
Use IRBuilder while simplifying unreachable.

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

13 years agoRevert my previous patch. The cmake build had already been fixed.
Rafael Espindola [Thu, 19 May 2011 00:02:45 +0000 (00:02 +0000)]
Revert my previous patch. The cmake build had already been fixed.

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

13 years agoUse IRBuilder while simplifying conditional branch.
Devang Patel [Wed, 18 May 2011 23:59:51 +0000 (23:59 +0000)]
Use IRBuilder while simplifying conditional branch.

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

13 years agoMore instcombine cleanup, towards improving debug line info.
Eli Friedman [Wed, 18 May 2011 23:58:37 +0000 (23:58 +0000)]
More instcombine cleanup, towards improving debug line info.

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

13 years agoRestore sanity to 131601.
Jim Grosbach [Wed, 18 May 2011 23:56:43 +0000 (23:56 +0000)]
Restore sanity to 131601.

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

13 years agoFix the cmake build.
Rafael Espindola [Wed, 18 May 2011 23:56:40 +0000 (23:56 +0000)]
Fix the cmake build.

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

13 years agoObjective C functions may use a magic '\1' on the name. Handle that when
Jim Grosbach [Wed, 18 May 2011 23:53:21 +0000 (23:53 +0000)]
Objective C functions may use a magic '\1' on the name. Handle that when
dealing with them in the MCJIT.

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

13 years agoShuffle StandardPasses.cpp into VMCore; add it to CMake.
Eli Friedman [Wed, 18 May 2011 23:51:11 +0000 (23:51 +0000)]
Shuffle StandardPasses.cpp into VMCore; add it to CMake.

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

13 years agoUse IRBuilder while simplifying branch.
Devang Patel [Wed, 18 May 2011 23:18:47 +0000 (23:18 +0000)]
Use IRBuilder while simplifying branch.

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

13 years agoRevert unintentional commit.
Eli Friedman [Wed, 18 May 2011 23:13:10 +0000 (23:13 +0000)]
Revert unintentional commit.

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

13 years agoMore instcombine simplifications towards better debug locations.
Eli Friedman [Wed, 18 May 2011 23:11:30 +0000 (23:11 +0000)]
More instcombine simplifications towards better debug locations.

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

13 years agoAdd missing mayLoad / mayStore flags to instruction definitions without patterns,
Cameron Zwarich [Wed, 18 May 2011 23:03:10 +0000 (23:03 +0000)]
Add missing mayLoad / mayStore flags to instruction definitions without patterns,
which fixes all of the CodeGen/MBlaze verifier failures.

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

13 years agoAdd a header patterned after MCDwarf.h for supporting Win64 exception handling
Charles Davis [Wed, 18 May 2011 22:48:24 +0000 (22:48 +0000)]
Add a header patterned after MCDwarf.h for supporting Win64 exception handling
under MC.

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

13 years agoSome better type safety enforcement in the standard pass list, along with some small...
David Chisnall [Wed, 18 May 2011 22:46:02 +0000 (22:46 +0000)]
Some better type safety enforcement in the standard pass list, along with some small tidies and some fixes for bugs that the stricter checking found.

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

13 years agoReserve the segment registers on x86 to fix verifier failures in any code that
Cameron Zwarich [Wed, 18 May 2011 22:24:48 +0000 (22:24 +0000)]
Reserve the segment registers on x86 to fix verifier failures in any code that
uses them.

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

13 years agoRemove comments as Chris requested.
Charles Davis [Wed, 18 May 2011 22:13:51 +0000 (22:13 +0000)]
Remove comments as Chris requested.

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

13 years agoReserve r29 on Alpha. This fixes all verifier failures in CodeGen/Alpha.
Cameron Zwarich [Wed, 18 May 2011 21:54:32 +0000 (21:54 +0000)]
Reserve r29 on Alpha. This fixes all verifier failures in CodeGen/Alpha.

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

13 years agoHandle perfect shuffle case that generates a vrev for vectors of floats.
Tanya Lattner [Wed, 18 May 2011 21:44:54 +0000 (21:44 +0000)]
Handle perfect shuffle case that generates a vrev for vectors of floats.
Add test case.

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

13 years agoThird pass at allowing plugins to modify default passes. This time with a tweak...
Eli Friedman [Wed, 18 May 2011 21:40:04 +0000 (21:40 +0000)]
Third pass at allowing plugins to modify default passes.  This time with a tweak so that we don't depend on an uninitialized argument.

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

13 years agoUse IRBuilder while simplifying return instruction.
Devang Patel [Wed, 18 May 2011 21:33:11 +0000 (21:33 +0000)]
Use IRBuilder while simplifying return instruction.

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

13 years agoFix an obvious typo in r131572.
Cameron Zwarich [Wed, 18 May 2011 21:29:07 +0000 (21:29 +0000)]
Fix an obvious typo in r131572.

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

13 years agoFix more of PR8825. Now all of CodeGen/ARM passes with VerifyCoalescing turned on.
Cameron Zwarich [Wed, 18 May 2011 21:25:14 +0000 (21:25 +0000)]
Fix more of PR8825. Now all of CodeGen/ARM passes with VerifyCoalescing turned on.

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

13 years agoWhen forming an ICmpZero LSRUse, normalize the non-IV operand
Dan Gohman [Wed, 18 May 2011 21:02:18 +0000 (21:02 +0000)]
When forming an ICmpZero LSRUse, normalize the non-IV operand
of the comparison, so that the resulting expression is fully
normalized. This fixes PR9939.

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

13 years agoSet debug location while setting insertion point.
Devang Patel [Wed, 18 May 2011 20:58:47 +0000 (20:58 +0000)]
Set debug location while setting insertion point.

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

13 years agoAdd some more Win64 EH directives:
Charles Davis [Wed, 18 May 2011 20:54:10 +0000 (20:54 +0000)]
Add some more Win64 EH directives:
- StartChained and EndChained delimit a chained unwind area, which can contain
  additional operations to be undone if an exception occurs inside of it.
- UnwindOnly declares that this function doesn't handle any exceptions. If it
  has a handler, it's an unwind handler instead of an exception handler.
- Lsda declares the location and size of the LSDA, which in the Win64 EH
  scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the
  LSDA; it's used by the Language-Specific Handler (the "Personality Function"
  from DWARF).

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

13 years agoSpread use of IRBuilder even more.
Devang Patel [Wed, 18 May 2011 20:53:17 +0000 (20:53 +0000)]
Spread use of IRBuilder even more.

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

13 years agoRevert r131556; it's breaking buildbots/clang tests.
Eli Friedman [Wed, 18 May 2011 20:39:27 +0000 (20:39 +0000)]
Revert r131556; it's breaking buildbots/clang tests.

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

13 years agoUse IRBuilder while simplifying switch instruction.
Devang Patel [Wed, 18 May 2011 20:35:38 +0000 (20:35 +0000)]
Use IRBuilder while simplifying switch instruction.

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

13 years agoDisassembly of tBcc was wrongly adding 4 to the SignExtend'ed imm8:'0' immediate...
Johnny Chen [Wed, 18 May 2011 20:32:41 +0000 (20:32 +0000)]
Disassembly of tBcc was wrongly adding 4 to the SignExtend'ed imm8:'0' immediate operand.

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

13 years agoUse IRBuilder while simplifying unwind.
Devang Patel [Wed, 18 May 2011 20:01:18 +0000 (20:01 +0000)]
Use IRBuilder while simplifying unwind.

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

13 years agoEnables vararg functions that pass all arguments via registers to be optimized into...
Chad Rosier [Wed, 18 May 2011 19:59:50 +0000 (19:59 +0000)]
Enables vararg functions that pass all arguments via registers to be optimized into tail-calls when possible.

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

13 years agoMore instcombine cleanup aimed towards improving debug line info.
Eli Friedman [Wed, 18 May 2011 19:57:14 +0000 (19:57 +0000)]
More instcombine cleanup aimed towards improving debug line info.

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

13 years agoAn imminent fix to the x86_64 byval logic will expose a flaw in the
Stuart Hastings [Wed, 18 May 2011 19:19:17 +0000 (19:19 +0000)]
An imminent fix to the x86_64 byval logic will expose a flaw in the
x86_64 sibcall logic.  I've filed PR9943 for the sibcall problem, and
this patch alters the testcase to work around the flaw.  When PR9943
is fixed, this patch should be reverted.

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

13 years agoSecond pass at allowing plugins to modify default passes. This time without bonus...
David Chisnall [Wed, 18 May 2011 19:00:41 +0000 (19:00 +0000)]
Second pass at allowing plugins to modify default passes.  This time without bonus inter-library dependencies.

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

13 years agoRevise r131553. Just use the type of the input node and forgo the bitcast. rdar:...
Evan Cheng [Wed, 18 May 2011 18:59:17 +0000 (18:59 +0000)]
Revise r131553. Just use the type of the input node and forgo the bitcast. rdar://9449159.

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

13 years agoFix an ARMTargetLowering::LowerSELECT bug: legalized result must have same type as...
Evan Cheng [Wed, 18 May 2011 18:47:27 +0000 (18:47 +0000)]
Fix an ARMTargetLowering::LowerSELECT bug: legalized result must have same type as input. Sorry test cases only trigger when dag combine is disabled. rdar://9449178

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

13 years agoUse IRBuilder while simplifying terminator.
Devang Patel [Wed, 18 May 2011 18:43:31 +0000 (18:43 +0000)]
Use IRBuilder while simplifying terminator.

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

13 years agoUse IRBuilder while simplifying unconditional branch.
Devang Patel [Wed, 18 May 2011 18:28:48 +0000 (18:28 +0000)]
Use IRBuilder while simplifying unconditional branch.

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

13 years agoUse IRBuilder while folding two entry PHINode.
Devang Patel [Wed, 18 May 2011 18:16:44 +0000 (18:16 +0000)]
Use IRBuilder while folding two entry PHINode.

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

13 years agoSwitch more inst insertion in instcombine to IRBuilder.
Eli Friedman [Wed, 18 May 2011 18:10:28 +0000 (18:10 +0000)]
Switch more inst insertion in instcombine to IRBuilder.

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

13 years agoCorrect typos in TestingGuide.html
Chad Rosier [Wed, 18 May 2011 18:07:16 +0000 (18:07 +0000)]
Correct typos in TestingGuide.html

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

13 years agoSet up IRBuilder for use during simplification.
Devang Patel [Wed, 18 May 2011 18:01:27 +0000 (18:01 +0000)]
Set up IRBuilder for use during simplification.

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

13 years agoSwitch more inst insertion in instcombine to IRBuilder.
Eli Friedman [Wed, 18 May 2011 17:58:37 +0000 (17:58 +0000)]
Switch more inst insertion in instcombine to IRBuilder.

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

13 years agofix typo
Matt Beaumont-Gay [Wed, 18 May 2011 17:37:10 +0000 (17:37 +0000)]
fix typo

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

13 years agoSwitch inst insertion in instcombine transform to IRBuilder.
Eli Friedman [Wed, 18 May 2011 17:31:55 +0000 (17:31 +0000)]
Switch inst insertion in instcombine transform to IRBuilder.

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

13 years agoUse IRBuiler while constant folding terminator.
Devang Patel [Wed, 18 May 2011 17:26:46 +0000 (17:26 +0000)]
Use IRBuiler while constant folding terminator.

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

13 years agoForce a triple on a couple of tests; we don't support fast-isel of ret on Win64.
Eli Friedman [Wed, 18 May 2011 17:16:37 +0000 (17:16 +0000)]
Force a triple on a couple of tests; we don't support fast-isel of ret on Win64.

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

13 years agoMerge pmovzx test case into existing file.
Stuart Hastings [Wed, 18 May 2011 17:02:04 +0000 (17:02 +0000)]
Merge pmovzx test case into existing file.

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

13 years agoFix inelegant initialization.
Stuart Hastings [Wed, 18 May 2011 15:54:26 +0000 (15:54 +0000)]
Fix inelegant initialization.

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

13 years agoPTX: add flag to disable mad/fma selection
Justin Holewinski [Wed, 18 May 2011 15:42:23 +0000 (15:42 +0000)]
PTX: add flag to disable mad/fma selection

Patch by Dan Bailey

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

13 years agoRevert commit 131534 since it seems to have broken several buildbots.
Duncan Sands [Wed, 18 May 2011 14:57:56 +0000 (14:57 +0000)]
Revert commit 131534 since it seems to have broken several buildbots.
Original log entry:
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.

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

13 years agoRefactor getActionType and getTypeToTransformTo ; place all of the 'decision'
Nadav Rotem [Wed, 18 May 2011 12:26:38 +0000 (12:26 +0000)]
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.

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

13 years agoNow that SrcBits and DestBits always represent the primitive size, rather
Duncan Sands [Wed, 18 May 2011 10:59:25 +0000 (10:59 +0000)]
Now that SrcBits and DestBits always represent the primitive size, rather
than either the primitive size or the element primitive size (in the case
of vectors), simplify the vector logic.  No functionality change.  There
is some distracting churn in the patch because I lined up comments better
while there - sorry about that.

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

13 years agoTighten up checking of the validity of casts. (1) The IR parser would
Duncan Sands [Wed, 18 May 2011 09:21:57 +0000 (09:21 +0000)]
Tighten up checking of the validity of casts.  (1) The IR parser would
happily accept things like "sext <2 x i32> to <999 x i64>".  It would
also accept "sext <2 x i32> to i64", though the verifier would catch
that later.  Fixed by having castIsValid check that vector lengths match
except when doing a bitcast.  (2) When creating a cast instruction, check
that the cast is valid (this was already done when creating constexpr
casts).  While there, replace getScalarSizeInBits (used to allow more
vector casts) with getPrimitiveSizeInBits in getCastOpcode and isCastable
since vector to vector casts are now handled explicitly by passing to the
element types; i.e. this bit should result in no functional change.

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

13 years agoTeach getCastOpcode about element-by-element vector casts. For example, "trunc"
Duncan Sands [Wed, 18 May 2011 07:13:41 +0000 (07:13 +0000)]
Teach getCastOpcode about element-by-element vector casts.  For example, "trunc"
can be used to turn a <4 x i64> into a <4 x i32> but getCastOpcode would assert
if you passed these types to it.  Note that this strictly extends the previous
functionality: if getCastOpcode previously accepted two vector types (i.e. didn't
assert) then it still will and returns the same opcode (BitCast).  That's because
before it would only accept vectors with the same bitwidth, and the new code only
touches vectors with the same length.  However if two vectors have both the same
bitwidth and the same length then their element types have the same bitwidth, so
the new logic will return BitCast as before.

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

13 years agoIn r131488 I misunderstood how VREV works. It splits the vector in half and splits...
Tanya Lattner [Wed, 18 May 2011 06:42:21 +0000 (06:42 +0000)]
In r131488 I misunderstood how VREV works. It splits the vector in half and splits each half. Therefore, the real problem was that we were using a VREV64 for a 4xi16, when we should have been using a VREV32.
Updated test case and reverted change to the PerfectShuffle Table.

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

13 years agoImplement the Win64 EH directive methods for the assembly language streamer.
Charles Davis [Wed, 18 May 2011 04:58:05 +0000 (04:58 +0000)]
Implement the Win64 EH directive methods for the assembly language streamer.

GAS has no such directives (not even mingw-w64 GAS has them), so I took
creative license with their names in assembly. I prefixed them all with
"w64_" to avoid namespace collisions, for example. If I discover that GAS
has taken a different approach, I'll change ours to match.

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

13 years agoEliminate dead dead code elimination code.
Jakob Stoklund Olesen [Wed, 18 May 2011 04:51:15 +0000 (04:51 +0000)]
Eliminate dead dead code elimination code.

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

13 years agoAlso use shrinkToUses after AdjustCopiesBackFrom().
Jakob Stoklund Olesen [Wed, 18 May 2011 04:51:12 +0000 (04:51 +0000)]
Also use shrinkToUses after AdjustCopiesBackFrom().

The 'last use' may not be in the same basic block, and we still want a correct
live range.

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

13 years agoWhile thinking about how to know where the functions' boundaries are for
Charles Davis [Wed, 18 May 2011 04:47:22 +0000 (04:47 +0000)]
While thinking about how to know where the functions' boundaries are for
the purposes of the Win64 EH tables, I realized we had no way to tell where
the function ends. (MASM bounds functions with PROC and ENDP keywords.)
Add a directive to delimit the end of the function, and rename the 'frame'
directive to more accurately reflect its duality with the new directive.

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

13 years agoProperly shrink live ranges after deleting dead copies. Clean up after all joined...
Jakob Stoklund Olesen [Wed, 18 May 2011 04:18:19 +0000 (04:18 +0000)]
Properly shrink live ranges after deleting dead copies. Clean up after all joined copies.

LiveInterval::shrinkToUses recomputes the live range from scratch instead of
removing snippets. This should avoid the problem with dangling live ranges.

Leave physreg identity copies alone. They can be created when joining a virtreg
with a physreg. They don't affect register allocation, and they will be removed
by the rewriter.

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

13 years agoFix typo.
Cameron Zwarich [Wed, 18 May 2011 02:29:50 +0000 (02:29 +0000)]
Fix typo.

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

13 years agoFix more of PR8825 by correctly using rGPR registers when lowering atomic
Cameron Zwarich [Wed, 18 May 2011 02:20:07 +0000 (02:20 +0000)]
Fix more of PR8825 by correctly using rGPR registers when lowering atomic
compare-and-swap intrinsics.

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

13 years agoStart trying to make InstCombine preserve more debug info. The idea here is to set...
Eli Friedman [Wed, 18 May 2011 01:28:27 +0000 (01:28 +0000)]
Start trying to make InstCombine preserve more debug info.  The idea here is to set the debug location on the IRBuilder, which will be then right location in most cases.  This should magically give many transformations debug locations, and fixing places which are missing a debug location will usually just means changing the code creating it to use the IRBuilder.

As an example, the change to InstCombineCalls catches a common case where a call to a bitcast of a function is rewritten.

Chris, does this approach look reasonable?

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

13 years agoUse ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.
Eli Friedman [Wed, 18 May 2011 00:32:01 +0000 (00:32 +0000)]
Use ReplaceInstUsesWith instead of replaceAllUsesWith where appropriate in instcombine.

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

13 years agoMake some of the fast-isel tests actually test fast-isel (and fix test failures).
Eli Friedman [Wed, 18 May 2011 00:00:10 +0000 (00:00 +0000)]
Make some of the fast-isel tests actually test fast-isel (and fix test failures).

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

13 years agoPreseve line numbers while simplifying CFG.
Devang Patel [Tue, 17 May 2011 23:29:05 +0000 (23:29 +0000)]
Preseve line numbers while simplifying CFG.

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

13 years agoActually, the address operand of the Thumb2 LDREX / STREX instructions *can*
Cameron Zwarich [Tue, 17 May 2011 23:26:20 +0000 (23:26 +0000)]
Actually, the address operand of the Thumb2 LDREX / STREX instructions *can*
take r13, so we can just make it a GPR. This fixes PR8825.

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

13 years agoCorrect a minor problem with the Thumb2 LDREX and STREX instruction encodings. They
Cameron Zwarich [Tue, 17 May 2011 23:11:12 +0000 (23:11 +0000)]
Correct a minor problem with the Thumb2 LDREX and STREX instruction encodings. They
were marked as taking a tGPR when in reality they take an rGPR.

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