Commit Graph

33222 Commits

Author SHA1 Message Date
Chris Lattner
c581acbbba Fix a pretty serious misfeature of the inliner: if it inlines a function
with multiple return values it inserts a PHI to merge them all together.
However, if the return values are all the same, it ends up with a pointless
PHI and this pointless PHI happens to really block SRoA from happening in 
at least a silly C++ example written by Doug, but probably others.  This 
fixes rdar://7339069.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 05:39:41 +00:00
Mike Stump
8138122a3f VS build fix, patch by Marius Wachtler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 02:14:13 +00:00
Jeffrey Yasskin
ee4eb33c25 Fix OProfileJITEventListener after r85182.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 01:06:51 +00:00
Eric Christopher
7b5e61707a Add objectsize intrinsic and hook it up through codegen. Doesn't
do anything than return "I don't know" at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 00:52:25 +00:00
Evan Cheng
dd22a45acc Now VFP instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 00:20:49 +00:00
Dan Gohman
7f712a1987 Add braces to avoid ambiguous else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 00:11:02 +00:00
Evan Cheng
699bebac4f Change Thumb1 and Thumb2 instructions to separate opcode from operands with a tab instead of a space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 00:08:59 +00:00
Jeffrey Yasskin
7a9034c4db Automatically do the equivalent of freeMachineCodeForFunction(F) when F is
being destroyed. This allows users to run global optimizations like globaldce
even after some functions have been jitted.

This patch also removes the Function* parameter to
JITEventListener::NotifyFreeingMachineCode() since it can cause that to be
called when the Function is partially destroyed. This change will be even more
helpful later when I think we'll want to allow machine code to actually outlive
its Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 00:03:05 +00:00
Victor Hernandez
f2becca90b Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:58:56 +00:00
Owen Anderson
6f55630830 Add a straight-forward implementation of SCCVN for aggressively eliminating scalar redundancies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:55:47 +00:00
Evan Cheng
162e30921d Change ARM asm strings to separate opcode from operands with a tab instead of a space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:45:59 +00:00
Victor Hernandez
046e78ce55 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:43:48 +00:00
Bob Wilson
dda9583e51 Try to get ahead of Johnny Chen and pro-actively add some more ARM encoding
bits.  Johnny, please review -- I do not have a good track record of getting
these right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:59:12 +00:00
Bob Wilson
d9ecd3108f Fix ARM encoding typo: Opcod3 is not passed to ASuI parent class.
Patch by Johnny Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:42:13 +00:00
Bob Wilson
7e053bb33c Add more ARM instruction encodings for 's' bit set and "rs" register encoding
bits.  Patch by Johnny Chen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:34:44 +00:00
David Goodwin
e10deca33e Allow the aggressive anti-dep breaker to process the same region multiple times. This is necessary because new anti-dependencies are exposed when "current" ones are broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:31:16 +00:00
Dan Gohman
06d4033a35 Simplify this code. LoopDeletion doesn't need to explicit check that
the loop exiting block dominates the latch block; if ScalarEvolution
can prove that the trip-count is finite, that's sufficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:18:58 +00:00
Dan Gohman
fe3595555a Code that checks WillNotOverflowSignedAdd before creating an Add
can safely use the NSW bit on the Add.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:14:22 +00:00
Ted Kremenek
7c44beaf93 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 22:06:01 +00:00
Dan Gohman
6665b0ea68 Teach BasicAA how to analyze Select instructions, and make it more
aggressive on PHI instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 21:55:43 +00:00
David Goodwin
ada0ef86d9 Define virtual destructor in *.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 19:41:00 +00:00
David Goodwin
348777110a Add aggressive anti-dependence breaker. Currently it is not the default for any target. Enable with -break-anti-dependencies=all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 19:32:42 +00:00
Dan Gohman
6000e253d4 Check in the experimental GEP splitter pass. This pass splits complex
GEPs (more than one non-zero index) into simple GEPs (at most one
non-zero index).  In some simple experiments using this it's not
uncommon to see 3% overall code size wins, because it exposes
redundancies that can be eliminated, however it's tricky to use
because instcombine aggressively undoes the work that this pass does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 19:12:14 +00:00
Anton Korobeynikov
8b5af25a14 Revert r85134, it breaks mingw build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 18:40:24 +00:00
Dan Gohman
91203cf87b When checking whether a def of an aliased register is dead, ask the
machineinstr whether the aliased register is dead, rather than the original
register is dead. This allows it to get the correct answer when examining
an instruction like this:
  CALLpcrel32 <ga:foo>, %AL<imp-def>, %EAX<imp-def,dead>
where EAX is dead but a subregister of it is still live. This fixes PR5294.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 18:26:18 +00:00
Sanjiv Gupta
be9e763697 Make PIC16 overlay a loadable pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 18:22:59 +00:00
Devang Patel
5a1033a8ed Do not use expensive sort().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 17:09:00 +00:00
David Goodwin
2e7be612d5 Break anti-dependence breaking out into its own class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 16:59:04 +00:00
Devang Patel
ac16d44e58 Add support to encode type info using llvm::Constant.
Patch by Talin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 16:54:35 +00:00
Dan Gohman
440e251c75 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 15:55:24 +00:00
Chris Lattner
48b59ec817 reapply r85085 with a bugfix to avoid infinite looping.
All of the 'demorgan' related xforms need to use 
dyn_castNotVal, not m_Not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 15:40:07 +00:00
Dan Gohman
a8225083ba Make LSR's OptimizeShadowIV ignore induction variables with negative
strides for now, because it doesn't handle them correctly. This fixes a
miscompile of SingleSource/Benchmarks/Misc-C++/ray.

This problem was usually hidden because indvars transforms such induction
variables into negations of canonical induction variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 15:32:57 +00:00
Evan Cheng
a5dc45e3c8 - Revert some changes from 85044, 85045, and 85047 that broke x86_64 tests and
bootstrapping. It's not safe to leave identity subreg_to_reg and insert_subreg
  around.
- Relax register scavenging to allow use of partially "not-live" registers. It's
  common for targets to operate on registers where the top bits are undef. e.g.
  s0 =
  d0 = insert_subreg d0<undef>, s0, 1
  ...
     = d0
  When the insert_subreg is eliminated by the coalescer, the scavenger used to
  complain. The previous fix was to keep to insert_subreg around. But that's
  brittle and it's overly conservative when we want to use the scavenger to 
  allocate registers. It's actually legal and desirable for other instructions
  to use the "undef" part of d0. e.g.
  s0 =
  d0 = insert_subreg d0<undef>, s0, 1
  ...
  s1 =
     = s1
     = d0
  We probably need add a "partial-undef" marker on machine operand so the
  machine verifier would not complain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 04:56:07 +00:00
Evan Cheng
85def16079 Revert 85085. It causes infinite looping during llvm-gcc build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 03:51:32 +00:00
Chandler Carruth
8b67f774e9 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:35:46 +00:00
Chris Lattner
863928fc39 Implement PR3266 & PR5276, folding:
not (or (icmp, icmp)) -> and(icmp, icmp)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:06:31 +00:00
Chris Lattner
1d871c5e54 fix PR5295 where the .ll parser didn't reject a function after a global
or global after a function with conflicting names.  Update some testcases
that were accidentally depending on this behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 23:22:50 +00:00
Daniel Dunbar
22bbd9b9b8 Suppress -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 23:11:06 +00:00
Chris Lattner
46264f020a fix PR5186: the JIT shouldn't try to codegen available_externally
functions it should just look them up like declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 23:06:42 +00:00
Chandler Carruth
18ad485bf5 Remove unused includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 22:38:41 +00:00
Jim Grosbach
dd5694203b of -> or
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 19:14:48 +00:00
Jim Grosbach
f639e9f9e6 80-column cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 18:55:46 +00:00
Sanjiv Gupta
e1ef91d275 Reapply 85006 with a minor fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 08:14:11 +00:00
Evan Cheng
4f54c1293a Add ARM getMatchingSuperRegClass to handle S / D / Q cross regclass coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:53:28 +00:00
Evan Cheng
ed3ad212ec Don't forget subreg indices when folding load / store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:52:27 +00:00
Evan Cheng
427c3ba97a Use isIdentityCopy. Fix a bozo bug (flipped condition) in InvalidateRegDef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:51:47 +00:00
Evan Cheng
d98e30f618 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:49:57 +00:00
Evan Cheng
d66f0015ad Do not delete identity insert_subreg even if dest is virtual. Let later passes delete them. This avoids register scavenger complain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:48:51 +00:00
Nick Lewycky
f5a86f45e7 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:57:41 +00:00
Nick Lewycky
6726b6d75a Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:33:48 +00:00