Commit Graph

54175 Commits

Author SHA1 Message Date
Evan Cheng
60f9061820 RegScavenger::enterBasicBlock should always reset register state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:49:10 +00:00
Evan Cheng
586f69a118 - Teach LSR to avoid changing cmp iv stride if it will create an immediate that
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
  later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
  users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
  iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:35:05 +00:00
Evan Cheng
b9d2c03d20 Use table to separate opcode from operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:16:34 +00:00
Evan Cheng
06b53c0d51 isLegalICmpImmediate should take a signed integer; code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:13:11 +00:00
Oscar Fuentes
8e3c16917c CMake: Hopefully unbreak the build by mimicking the changes on the
other build system about the new C_INCLUDE_DIRS configure option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 06:48:09 +00:00
Rafael Espindola
7f9ec910a3 Add the --with-c-include-dirs to llvm's configure.
The clang patch is next.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 05:46:09 +00:00
Oscar Fuentes
a447cfea45 CMake: Pass -lm to check_symbol_exists for detecting several math
functions like floorf, ceilf, ... Add test for detecting nearbyintf.

This change was prompted by test/Transforms/SimplifyLibCalls/floor.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 05:36:09 +00:00
Chris Lattner
66c04c48de use getPredicateOnEdge to fold comparisons through PHI nodes,
which implements GCC PR18046.  This also gets us 360 more
jump threads on 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 05:24:05 +00:00
Chris Lattner
f496e79f44 various fixes to the lattice transfer functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 04:57:13 +00:00
Chris Lattner
0e0ff29271 switch jump threading to use getPredicateOnEdge in one place
making the new LVI stuff smart enough to subsume some special
cases in the old code.  Disable them when LVI is around, the
testcase still passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 04:37:50 +00:00
Chris Lattner
b52675b643 Add a new getPredicateOnEdge method which returns more rich information for
constant constraints.  Improve the LVI lattice to include inequality 
constraints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 04:36:58 +00:00
Jim Grosbach
7707a0df5b Move the utility function UpdateTerminator() from CodePlacementOpt() into
MachineBasicBlock so other passes can utilize it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 03:55:33 +00:00
Jim Grosbach
01dec0e545 Revert 86857. It's causing consumer-typeset to fail, and there's a better way to do it forthcoming anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 03:28:35 +00:00
Eric Christopher
116664a697 Use stubs when we have them, otherwise use code we already have,
otherwise create a stub.

Add a test to make sure we don't create extraneous stubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 03:12:18 +00:00
Daniel Dunbar
dfa9261f68 Add the braces gcc suggested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:52:56 +00:00
Nick Lewycky
ad108baf47 Add CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd and
CreateNSWSub functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:08:11 +00:00
Chris Lattner
3e04a05672 should not commit when distracted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 02:04:17 +00:00
Dan Gohman
72b2990a74 Make the BranchFolderPass class local to BranchFolding.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:59:26 +00:00
Chris Lattner
a5810add9c We now thread some impossible condition information with LVI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:55:20 +00:00
Dan Gohman
8520149db1 Minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:51:28 +00:00
Chris Lattner
87e9f59c7a with the new code we can thread non-instruction values. This
allows us to handle the test10 testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:41:34 +00:00
Chris Lattner
1c96b4187b this argument can be an arbitrary value, it doesn't need to be an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:37:43 +00:00
Chris Lattner
38392bbeb8 expose edge information and switch j-t to use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:29:10 +00:00
Lang Hames
f035ce58bc Fixed an iteration condition in PreAllocSplitting. This should fix some miscompilations casued by PreAllocSplitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:24:08 +00:00
Chris Lattner
b8c124c343 move some stuff into DEBUG's and turn on lazy-value-info for
the basic.ll testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:22:16 +00:00
Eric Christopher
5cf0aedd0b Fix typo, cleanup whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 01:06:08 +00:00
Devang Patel
afa5a34b30 Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 00:50:58 +00:00
Dan Gohman
ad6af45dc1 Tail merge at any size when there are two potentials blocks and one
can be made to fall through into the other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 00:39:10 +00:00
Bill Wendling
73b5551058 Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 23:17:02 +00:00
Bruno Cardoso Lopes
9089ba8e5e A real solution for the first part of PR5445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 23:09:33 +00:00
Chris Lattner
1697652922 make LazyValueInfo actually to some stuff. This isn't very tested but improves
strswitch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 22:48:44 +00:00
Chris Lattner
2ad00bf99d pass TD into a SimplifyCmpInst call. Add another case that
uses LVI info when -enable-jump-threading-lvi is passed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 22:31:38 +00:00
Dan Gohman
ffe644ebf4 Promote MergePotentialsElt and SameTailElt to be regular classes
instead of typedefs for std::pair. This simplifies the type of
SameTails, which previously was std::vector<std::pair<std::vector<std::pair<unsigned, MachineBasicBlock *> >::iterator, MachineBasicBlock::iterator>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 21:57:02 +00:00
Kenneth Uildriks
c158dde219 x86 users can now return arbitrary sized structs. Structs too large to fit in return registers will be returned through a hidden sret parameter introduced during SelectionDAG construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:59:24 +00:00
Dan Gohman
7cc253e3b8 Revert this line of 86871.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:56:05 +00:00
Devang Patel
3380cc5307 If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:55:08 +00:00
Dan Gohman
412a3b90d1 Check in the changes to this file too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:49:34 +00:00
Dan Gohman
2210c0bea8 Add support for tail duplication to BranchFolding, and extend
tail merging support to handle more cases.
 - Recognize several cases where tail merging is beneficial even when
   the tail size is smaller than the generic threshold.
 - Make use of MachineInstrDesc::isBarrier to help detect
   non-fallthrough blocks.
 - Check for and avoid disrupting fall-through edges in more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:48:59 +00:00
Jakob Stoklund Olesen
3e20475fee Fix liveness calculation when splitting critical edges during PHI elimination.
- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
  MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
  set rather than successor live-in set.

This feature still causes some miscompilations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:31:31 +00:00
Devang Patel
eba4ed9cbb Reenable StackTracke.cpp test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:08:42 +00:00
Devang Patel
4a8efb0c39 Add SetDebugLocation() variant to
add debug info location to an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:06:06 +00:00
Evan Cheng
77e4751011 Add TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded into target icmp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:05:52 +00:00
Jim Grosbach
f4997e87e3 Do jump table adjustment before constant island allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:04:24 +00:00
Dan Gohman
cdc06ba5df Fix indentation level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:42:28 +00:00
Dan Gohman
4e3f125e18 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:38:14 +00:00
Dan Gohman
a127edceae Prefix MBB numbers with "BB#" in debug output to make it clear what
the numbers mean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:23:17 +00:00
Dan Gohman
d194498d26 Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:18:34 +00:00
Dan Gohman
641c6f983e Fix a copy+pasto in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:14:02 +00:00
Dan Gohman
adaace8aa8 Set isBarrier = 1 on return instructions, as they are control barriers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86851 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:11:07 +00:00
Dan Gohman
e94975ee64 Use a tab in INT3's asm string, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 18:07:16 +00:00