Commit Graph

3675 Commits

Author SHA1 Message Date
Dan Gohman
618f17702d When CodeGen'ing unoptimized code, there may be unfolded constant expressions
in global initializers. Instead of aborting, attempt to fold them on the
spot. If folding succeeds, emit the folded expression instead.

This fixes PR6255.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 22:02:38 +00:00
Dan Gohman
c2e93b255e In guaranteed tailcall mode, don't decline the tailcall optimization
for blocks ending in "unreachable".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-08 20:34:14 +00:00
Evan Cheng
00a99a3584 Run codegen dce pass for all targets at all optimization levels. Previously it's
only run for x86 with fastisel. I've found it being very effective in
eliminating some obvious dead code as result of formal parameter lowering
especially when tail call optimization eliminated the need for some of the loads
from fixed frame objects. It also shrinks a number of the tests. A couple of
tests no longer make sense and are now eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 09:07:11 +00:00
Evan Cheng
e3e86dce64 Remove a large test case that (soon will) no longer make sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 09:00:30 +00:00
Rafael Espindola
2f82ca904a Fix alignment on ppc linux. This fixes the build of crtend.o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 03:32:21 +00:00
Evan Cheng
f22f9b35d6 Do not emit callseq instructions around sibcalls. This eliminated some unnecessary stack adjustments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 03:28:46 +00:00
Bob Wilson
e6373eb826 Handle AddrMode6 (for NEON load/stores) in Thumb2's rewriteT2FrameIndex.
Radar 7614112.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 00:24:38 +00:00
Jakob Stoklund Olesen
d450e5b886 Don't unroll loops containing function calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 23:21:31 +00:00
Bill Wendling
63d58ebd09 Make test more fucused eliminating extraneous bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 11:21:05 +00:00
Evan Cheng
401f030fb8 Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95373 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 06:37:00 +00:00
Evan Cheng
5f94193b36 Handle tail call with byval arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 02:21:12 +00:00
Evan Cheng
5ba8bf6d28 When the scheduler unfold a load folding instruction it move some of the predecessors to the unfolded load. It decides what gets moved to the load by checking whether the new load is using the predecessor as an operand. The check neglects the cases whether the predecessor is a flagged scheduling unit.
rdar://7604000


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:27:11 +00:00
Bill Wendling
744f579b63 An empty global constant (one of size 0) may have a section immediately
following it. However, the EmitGlobalConstant method wasn't emitting a body for
the constant. The assembler doesn't like that. Before, we were generating this:

  .zerofill __DATA, __common, __cmd, 1, 3

This fix puts us back to that semantic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 00:17:02 +00:00
Jakob Stoklund Olesen
e4d2d96cc8 Fix small bug in handling instructions with more than one implicitly defined operand.
ProcessImplicitDefs would only mark one operand per instruction with <undef>.
This fixed PR6086.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95319 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 18:46:28 +00:00
Evan Cheng
1f2fda97b1 Re-enable x86 tail call optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 06:47:24 +00:00
Chris Lattner
87c06d6179 add support for the sparcv9-*-* target triple to turn on
64-bit sparc codegen.  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 06:34:01 +00:00
Evan Cheng
8148ae8847 Speculatively disable x86 automatic tail call optimization while we track down a self-hosting issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 21:40:40 +00:00
Evan Cheng
394f1b5334 Make test less fragile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 21:39:04 +00:00
Evan Cheng
febc81680c Revert 94937 and move the noreturn check to codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 03:55:59 +00:00
Evan Cheng
86809ccdad Allow all types of callee's to be tail called. But avoid automatic tailcall if the callee is a result of bitcast to avoid losing necessary zext / sext etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 03:28:02 +00:00
Dale Johannesen
9a6636b2cd Reapply 95050 with a tweak to check the register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 01:40:33 +00:00
Chris Lattner
e0bb20cc03 make these less sensitive to asm verbose changes by disabling it for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 00:48:53 +00:00
Dale Johannesen
62a04136d5 Test revert 95050; there's a good chance it's causing
buildbot failure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 18:52:56 +00:00
Evan Cheng
b2c9290a01 Perform sibcall in some cases when arguments are passes memory. Look for cases
where callee's arguments are already in the caller's own caller's stack and
they line up perfectly. e.g.

extern int foo(int a, int b, int c);

int bar(int a, int b, int c) {
  return foo(a, b, c);
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95053 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:22:50 +00:00
Dale Johannesen
5ce0ee9c09 Make local RA smarter about reusing input register of a copy
as output.  Needed for (functional) correctness in inline asm,
and should be generally beneficial.  7361612.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 02:08:02 +00:00
Evan Cheng
7276c8c2b5 Fix PR6196. GV callee may not be a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 22:40:09 +00:00
Dan Gohman
a00ef1122c Update this test for a trivial register allocation difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 19:00:32 +00:00
Evan Cheng
0a4fd46d9e Undo r94946 now all the tests are passing again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-01 02:13:39 +00:00
Evan Cheng
843bd699f6 Avoid recursive sibcall's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-31 06:44:49 +00:00
Anton Korobeynikov
90cfc130d6 Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 14:08:12 +00:00
Evan Cheng
a6bff982c1 Allow more tailcall optimization: calls with inputs that are all passed in registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 01:22:00 +00:00
Evan Cheng
7096ae48c9 Catch more trivial tail call opportunities: no inputs and output types match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 06:45:59 +00:00
Chris Lattner
a34103f6fa convert the last 3 targets to use EmitFunctionBody() now that
it has before/end body hooks.

 lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp |   49 ++-----------
 lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp   |   87 ++++++------------------
 lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp |   56 +++------------
 test/CodeGen/XCore/ashr.ll                      |    2 
 4 files changed, 48 insertions(+), 146 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:22:43 +00:00
Evan Cheng
5fef8bc1cb Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is different from its inputs.
This fixes PR6146.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:57:22 +00:00
Chris Lattner
d49fe1b6bc Give AsmPrinter the most common expected implementation of
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define 
runOnMachineFunction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:28:58 +00:00
Chris Lattner
10e7c60c04 emit a 0 byte instead of a noop if a function is empty on darwin.
"0" is nice and target independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:06:32 +00:00
Chandler Carruth
6f03433516 Quick fix to a test that is currently failing on every Linux build bot. No idea
if this is the "correct" fix, but it seems a strict improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:36:15 +00:00
Evan Cheng
b17124553d Perform trivial tail call optimization for callees with "C" ABI. These are done
even when -tailcallopt is not specified and it does not require changing ABI.
First case is the most trivial one. Perform tail call optimization when both
the caller and callee do not return values and when the callee does not take
any input arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 06:25:16 +00:00
Chris Lattner
c618c8aff4 emit jump table an alias ".set" directives through MCStreamer as
assignments.

.set x, a-b

is the same as:

x = a-b



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 21:53:08 +00:00
Rafael Espindola
2e2563bf8e Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Original patch by Sandeep Patel and updated by me.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 20:21:43 +00:00
Chris Lattner
6a315c358c eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
that has it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 20:20:43 +00:00
Evan Cheng
8c7ecaf524 Implement cond ? -1 : 0 with sbb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 02:00:44 +00:00
Rafael Espindola
0173b74c55 Update test for darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 15:32:10 +00:00
Chris Lattner
5c78034bc8 we removed support for darwin8 tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 07:43:40 +00:00
Rafael Espindola
f166ed7324 Fix PR6134.
We are not emitting alignments on Darwin for "bar". Not sure what is the
correct way to do it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 02:27:39 +00:00
Daniel Dunbar
34b6ea6cef Attempt to unbreak test on Linux. Chris, please check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 00:54:13 +00:00
Chris Lattner
4e4af5978c just remove this test, it is not reduced, is not clear what its testing for and
it is dying due to fragility in the asmprinter .s comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 19:23:09 +00:00
Mon P Wang
6fb474bd3c It seems better to scalarize vectors of size 1 instead of widening them.
Add support to widen SETCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 00:24:43 +00:00
Mon P Wang
eb38ebf15c Improved widening loads by adding support for wider loads if
the alignment allows.  Fixed a bug where we didn't use a
vector load/store for PR5626.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 00:05:03 +00:00
Chris Lattner
52492ac0d0 Change constantexpr global variable initializers to convert the constants
to MCExpr then emit them through MCStreamer with EmitValue.  I think all
global variable initializers are now going through mcstreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 06:17:14 +00:00