Commit Graph

8648 Commits

Author SHA1 Message Date
Dan Gohman
dab249b3b7 Enable hoisting of loads from constant memory by default. In cases where
they are lowered to instruction sequences more complex than a simple
load, such that CodeGen cannot rematerialize them, a reload from a
spill slot is likely to be cheaper than the complex sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 19:00:10 +00:00
Daniel Dunbar
2b86caf05b Unbreak test, Bruno please check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 07:18:49 +00:00
Evan Cheng
2ef9c8a43d More consistent thumb1 asm printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 06:57:41 +00:00
Evan Cheng
5b397c93a5 Shrink ldr / str [sp, imm0-1024] to 16-bit instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 06:32:27 +00:00
Bruno Cardoso Lopes
2045c47aff - Add sugregister logic to handle f64=(f32,f32).
- Support mips1 like load/store of doubles:

Instead of:
  sdc $f0, X($3)
Generate:
  swc $f0, X($3)
  swc $f1, X+4($3)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 06:06:13 +00:00
Bill Wendling
77bd09b650 Test from Dhrystone to make sure that we're not emitting an aligned load for a
string that's aligned at 8-bytes instead of 16-bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 01:33:57 +00:00
Bob Wilson
41a0456a3c Fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 23:30:38 +00:00
Richard Osborne
bea7df56ce Add XCore support for indirectbr / blockaddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 23:20:42 +00:00
Bob Wilson
60f34b9fb0 Tail duplication still needs to iterate. Duplicating new instructions onto
the tail of a block may make that block a new candidate for duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 22:52:37 +00:00
Bill Wendling
9b5928b989 Not all ASM has # for comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 21:54:13 +00:00
Jakob Stoklund Olesen
0b25ae1afb Fix PR5300.
When TwoAddressInstructionPass deletes a dead instruction, make sure that all
register kills are accounted for. The 2-addr register does not get special
treatment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 21:33:35 +00:00
Jakob Stoklund Olesen
5052c1547e Fix inverted test and add testcase from failing self-host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 00:02:18 +00:00
Jakob Stoklund Olesen
6c8a0715c4 Remove fragile test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 21:52:40 +00:00
Jim Grosbach
f04777b945 Enable arm jumpt table adjustment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89143 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 21:24:11 +00:00
Anton Korobeynikov
d2aad77261 Forgot to commit test fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 20:38:36 +00:00
Jakob Stoklund Olesen
95a2c8f1d0 Enable -split-phi-edges by default, except when -regalloc=local.
The local register allocator doesn't like it when LiveVariables is run.
We should also disable edge splitting under -O0, but that has to wait a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 19:15:50 +00:00
Evan Cheng
076e085698 Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to use postinc iv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 18:10:11 +00:00
Evan Cheng
9e97f3c2e2 Revert 89021. It's miscompiling llvm-gcc driver driver at -O0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 09:55:52 +00:00
Jakob Stoklund Olesen
2cbe71cdf0 Enable -split-phi-edges by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 01:07:22 +00:00
Evan Cheng
6cccc30679 MOV64rm should be marked isReMaterializable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 00:55:55 +00:00
Jim Grosbach
1187285e90 Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 00:20:26 +00:00
Jim Grosbach
727f0c37fb Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 00:03:38 +00:00
Jim Grosbach
2c0fb63738 Cleanup. Missed removing these when converting. Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 00:00:33 +00:00
Dan Gohman
1d8c9e721e Fix this test - there don't appear to be any actual Reload Reuses
in this testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 23:49:55 +00:00
Dan Gohman
10190cceec Revert r87049, which was the workaround for the regression triggered
by the recent FixedStackPseudoSourceValue-related changes, now that
the specific bug that affected it is fixed, in r88954.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 23:43:42 +00:00
Jeffrey Yasskin
feada9462b Revert the test from r88984. It relies on being able to mmap 16GB of
address space (though it only uses a small fraction of that), and the
buildbots disallow that.

Also add a comment to the Makefile's ulimit line warning future
developers that changing it won't work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 23:32:30 +00:00
Jim Grosbach
9f07f3b009 Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 23:19:29 +00:00
Jeffrey Yasskin
d1ba06bf13 Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:41:33 +00:00
Evan Cheng
600c043697 - Check memoperand alignment instead of checking stack alignment. Most load / store folding instructions are not referencing spill stack slots.
- Mark MOVUPSrm re-materializable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 21:56:03 +00:00
Jim Grosbach
2f74603460 Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:04:15 +00:00
Lang Hames
0d6dd493f4 Added a testcase for PR5495.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:03:13 +00:00
Jim Grosbach
4adcade9b7 Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:46:46 +00:00
Jim Grosbach
c0517504e5 tbb opt off by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 17:24:45 +00:00
David Greene
ddff941357 Support spill comments.
Have the asm printer emit a comment if an instruction is a spill or
reload and have the spiller mark copies it introdues so the asm printer
can also annotate those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 15:12:23 +00:00
Evan Cheng
39aa7251a2 Check if subreg index is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 06:31:49 +00:00
Evan Cheng
285a7d57dc For some targets, a copy can use a register multiple times, e.g. ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:52:06 +00:00
Evan Cheng
2d947263d5 xfail for now. It has been failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 05:44:04 +00:00
Bruno Cardoso Lopes
6e0b658dad - Fix a small bug while handling target constant pools (one param was missing).
- Add a smarter constant pool loading, instead of:

lui $2, %hi($CPI1_0)
addiu $2, $2, %lo($CPI1_0)
lwc1 $f0, 0($2)

Generate:

lui $2, %hi($CPI1_0)
lwc1 $f0, %lo($CPI1_0)($2)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 04:33:42 +00:00
Jim Grosbach
a44321776e Detect need for autoalignment of the stack earlier to catch spills more
conservatively. eliminateFrameIndex() machinery adjust to handle addr mode
6 (vld1/vst1) used for spills. Fix tests to expect aligned Q-reg spilling

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 21:45:34 +00:00
Nick Lewycky
feb8018764 Revert r88830 and r88831 which appear to have caused a selfhost buildbot some
grief. I suspect this patch merely exposed a bug else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 07:47:32 +00:00
Nick Lewycky
052d9cb0a8 Correct typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 06:16:57 +00:00
Nick Lewycky
df772f257f Teach instcombine to look for booleans in wider integers when it encounters a
zext(icmp). It may be able to optimize that away. This fixes one of the cases
in PR5438.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 05:55:17 +00:00
Jim Grosbach
e11d26b3d8 remove xfail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 21:57:35 +00:00
Richard Osborne
13c4fabf99 Add XCore support for arbitrary-sized aggregate returns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 19:33:35 +00:00
Nick Lewycky
20162ac566 Teach BasicAA that a constant expression can't alias memory provably not
allocated until runtime (such as an alloca). Patch by Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 06:15:14 +00:00
Evan Cheng
fae3e92345 Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 03:42:17 +00:00
Evan Cheng
d57cdd5683 - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the
  sub-register instead.
This fixes PR5423.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:55:43 +00:00
Evan Cheng
e17ae4f82e Add radar number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:11:32 +00:00
Evan Cheng
8fdd84cfa7 Fix PR5412: Fix an inverted check and another missing sub-register check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:09:09 +00:00
Dan Gohman
ed9bab3b4d Enable the tail call optimization when the caller returns undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:06:30 +00:00
Evan Cheng
0cd22dd738 When expanding t2STRDi8 r, r to two stores, add kill markers correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 01:50:00 +00:00
Evan Cheng
1f6a3c820a Fix PR5411. Bug in UpdateKills. A reg def partially define its super-registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 23:16:41 +00:00
David Greene
1924aabf99 Move DebugInfo checks into EmitComments and remove them from
target-specific AsmPrinters.  Not all comments need DebugInfo.

Re-enable the line numbers comment test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:34:57 +00:00
Dan Gohman
c4c550c758 When optimizing for size, don't tail-merge unless it's likely to be a
code-size win, and not when it's only likely to be code-size neutral,
such as when only a single instruction would be eliminated and a new
branch would be required.

This fixes rdar://7392894.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:02:15 +00:00
Evan Cheng
236490d870 Fix PR5410: LiveVariables lost subreg def:
D0<def,dead> = ...
...
             = S0<use, kill>
S0<def>      = ...
...
D0<def>      = 

The first D0 def is correctly marked dead, however, livevariables should have
added an implicit def of S0 or we end up with a use without a def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 20:36:40 +00:00
Dan Gohman
01205a80f5 Don't let a noalias difference disrupt the tailcall optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:49:38 +00:00
Dale Johannesen
1e608819aa Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:45:18 +00:00
Daniel Dunbar
6242495be2 Update test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:01:58 +00:00
Jim Grosbach
cb2c2b738a Clean up testcase a bit. Simplify case blocks and adjust switch instruction to not take an undefined value as input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 17:19:09 +00:00
Benjamin Kramer
9e3728be62 Fix typo in run line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 12:35:27 +00:00
Gabor Greif
8bedf029f0 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 09:44:17 +00:00
Chris Lattner
dbab4dc942 implement a nice little efficiency hack in the inliner. Since we're now
running IPSCCP early, and we run functionattrs interlaced with the inliner,
we often (particularly for small or noop functions) completely propagate
all of the information about a call to its call site in IPSSCP (making a call
dead) and functionattrs is smart enough to realize that the function is
readonly (because it is interlaced with inliner).

To improve compile time and make the inliner threshold more accurate, realize
that we don't have to inline dead readonly function calls.  Instead, just 
delete the call.  This happens all the time for C++ codes, here are some
counters from opt/llvm-ld counting the number of times calls were deleted vs
inlined on various apps:

Tramp3d opt:
  5033 inline                - Number of call sites deleted, not inlined
 24596 inline                - Number of functions inlined
llvm-ld:
  667 inline           - Number of functions deleted because all callers found
  699 inline           - Number of functions inlined

483.xalancbmk opt:
  8096 inline                - Number of call sites deleted, not inlined
 62528 inline                - Number of functions inlined
llvm-ld:
   217 inline           - Number of allocas merged together
  2158 inline           - Number of functions inlined

471.omnetpp:
  331 inline                - Number of call sites deleted, not inlined
 8981 inline                - Number of functions inlined
llvm-ld:
  171 inline           - Number of functions deleted because all callers found
  629 inline           - Number of functions inlined


Deleting a call is much faster than inlining it, and is insensitive to the
size of the callee. :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:56:08 +00:00
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
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
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
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
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
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
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
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
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
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
Duncan Sands
a3da922a27 Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end.  If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game.  There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted.  But since no passes do anything interesting with it yet
this will have to wait for later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 15:34:13 +00:00
Evan Cheng
012397489b Add nounwind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 07:11:02 +00:00
Chris Lattner
f1e9cf5020 remove condprop testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 05:25:16 +00:00
Daniel Dunbar
95470b73ba Add missing run line. Devang, please check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:10:03 +00:00
Bill Wendling
5606ec894e Fix test to work on every platform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:44:22 +00:00
Bill Wendling
13f6135742 Fix test to work on every platform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:41:32 +00:00
Devang Patel
3bbc9b4590 XFAIL for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:41:10 +00:00
Bill Wendling
ee161a6824 Make sure that the exception handling data has the same visibility as the
function it's generated for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:24:59 +00:00
Devang Patel
39ae3ff6d1 Do not assume first function scope seen represents current function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:31:36 +00:00
Chris Lattner
2b9024c877 oops, didn't mean to commit this, no harm, but add a todoops, didn't mean to commit this, no harm, but add a todoo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:27:54 +00:00
Chris Lattner
10f2d13d58 Stub out a new lazy value info pass, which will eventually
vend value constraint information to the optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:22:30 +00:00
Devang Patel
2f105c6e18 While creating DbgScopes, do not forget parent scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:18:40 +00:00
Evan Cheng
f40888dc9b Block terminator may be a switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:00:21 +00:00
Bill Wendling
6b41aba7ce Test this on Darwin only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:18:33 +00:00
Dale Johannesen
9a645cd9d4 Emit correct code when making a ConstantPool entry for a vector
constant whose component type is not a legal type for the target.
(If the target ConstantPool cannot handle this type either, it has
an opportunity to merge elements.  In practice any target with
8-bit bytes must support i8 *as data*).  7320806 (partial).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:16:41 +00:00
Chris Lattner
055d046f48 implement a TODO by teaching jump threading about "xor x, 1".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:39:16 +00:00
Bill Wendling
b19a5e9be6 Modify how the prologue encoded the "move" information for the FDE. GCC
generates a sequence similar to this:

__Z4funci:
LFB2:
        mflr r0
LCFI0:
        stmw r30,-8(r1)
LCFI1:
        stw r0,8(r1)
LCFI2:
        stwu r1,-80(r1)
LCFI3:
        mr r30,r1
LCFI4:

where LCFI3 and LCFI4 are used by the FDE to indicate what the FP, LR, and other
things are. We generated something more like this:

Leh_func_begin1:
        mflr r0
        stw r31, 20(r1)
        stw r0, 8(r1)
Llabel1:
        stwu r1, -80(r1)
Llabel2:
        mr r31, r1

Note that we are missing the "mr" instruction. This patch makes it more like the
GCC output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:14:04 +00:00
Chris Lattner
103f2434b8 fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 22:02:09 +00:00
Chris Lattner
f3183f6da6 Make jump threading eliminate blocks that just contain phi nodes,
debug intrinsics, and an unconditional branch when possible.  This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:40:01 +00:00
Evan Cheng
81ebdcf7dd Generalize lsr code that optimize loop to count down towards zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:14:05 +00:00
Dan Gohman
14bbbf3168 Optimize test more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 21:02:18 +00:00
Duncan Sands
710c37c494 Teach DSE to eliminate useless trampolines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 13:49:50 +00:00
Victor Hernandez
8e345a1c41 Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 08:32:25 +00:00
Chris Lattner
8fb02511d2 optimize test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:44:36 +00:00
Chris Lattner
c22d4d1500 unify the code that determines whether it is a good idea to change the type
of a computation.  This fixes some infinite loops when dealing with TD that
has no native types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 07:23:37 +00:00
Nick Lewycky
58571d663c Reapply r86359, "Teach dead store elimination that certain intrinsics write to
memory just like a store" with bug fixed (partial-overwrite.ll is the
regression test).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 06:46:40 +00:00
Chris Lattner
fddcf47a24 make jump threading recursively simplify expressions instead of doing it
just one level deep.  On the testcase we go from getting this:

F1:                                               ; preds = %T2
  %F = and i1 true, %cond                         ; <i1> [#uses=1]
  br i1 %F, label %X, label %Y

to a fully threaded:

F1:                                               ; preds = %T2
  br label %Y


This changes gets us to the point where we're forming (too many) switch 
instructions on doug's strswitch testcase.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:57:31 +00:00