Dale Johannesen
c84816a62e
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.
llvm-svn: 95050
2010-02-02 02:08:02 +00:00
Evan Cheng
a49d8e6d38
Fix PR6196. GV callee may not be a function.
...
llvm-svn: 95017
2010-02-01 22:40:09 +00:00
Dan Gohman
36bca4e4ba
Update this test for a trivial register allocation difference.
...
llvm-svn: 94989
2010-02-01 19:00:32 +00:00
Evan Cheng
ed8ca56eeb
Undo r94946 now all the tests are passing again.
...
llvm-svn: 94970
2010-02-01 02:13:39 +00:00
Evan Cheng
7f62def0f9
Avoid recursive sibcall's.
...
llvm-svn: 94946
2010-01-31 06:44:49 +00:00
Anton Korobeynikov
25df248382
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.
llvm-svn: 94889
2010-01-30 14:08:12 +00:00
Evan Cheng
70f714fdbe
Allow more tailcall optimization: calls with inputs that are all passed in registers.
...
llvm-svn: 94873
2010-01-30 01:22:00 +00:00
Evan Cheng
297a494f55
Catch more trivial tail call opportunities: no inputs and output types match.
...
llvm-svn: 94804
2010-01-29 06:45:59 +00:00
Chris Lattner
cc9a6f0580
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(-)
llvm-svn: 94741
2010-01-28 06:22:43 +00:00
Evan Cheng
346af88396
Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is different from its inputs.
...
This fixes PR6146.
llvm-svn: 94731
2010-01-28 01:57:22 +00:00
Chris Lattner
73de5fbfc3
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.
llvm-svn: 94722
2010-01-28 01:28:58 +00:00
Chris Lattner
565896b9eb
emit a 0 byte instead of a noop if a function is empty on darwin.
...
"0" is nice and target independent.
llvm-svn: 94718
2010-01-28 01:06:32 +00:00
Chandler Carruth
4fe7a3bc08
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.
llvm-svn: 94675
2010-01-27 10:36:15 +00:00
Evan Cheng
85476f304c
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.
llvm-svn: 94664
2010-01-27 06:25:16 +00:00
Chris Lattner
b657c4cdc3
emit jump table an alias ".set" directives through MCStreamer as
...
assignments.
.set x, a-b
is the same as:
x = a-b
llvm-svn: 94596
2010-01-26 21:53:08 +00:00
Rafael Espindola
dcb03f0f6b
Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
...
Original patch by Sandeep Patel and updated by me.
llvm-svn: 94582
2010-01-26 20:21:43 +00:00
Chris Lattner
3dd38a8112
eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
...
that has it.
llvm-svn: 94581
2010-01-26 20:20:43 +00:00
Evan Cheng
555f61bf58
Implement cond ? -1 : 0 with sbb.
...
llvm-svn: 94490
2010-01-26 02:00:44 +00:00
Rafael Espindola
4cb52db485
Update test for darwin.
...
llvm-svn: 94421
2010-01-25 15:32:10 +00:00
Chris Lattner
9b83727cfe
we removed support for darwin8 tools.
...
llvm-svn: 94414
2010-01-25 07:43:40 +00:00
Rafael Espindola
a1141dd6ab
Fix PR6134.
...
We are not emitting alignments on Darwin for "bar". Not sure what is the
correct way to do it.
llvm-svn: 94400
2010-01-25 02:27:39 +00:00
Daniel Dunbar
75652a6f2b
Attempt to unbreak test on Linux. Chris, please check.
...
llvm-svn: 94399
2010-01-25 00:54:13 +00:00
Chris Lattner
45dd2327cb
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.
llvm-svn: 94372
2010-01-24 19:23:09 +00:00
Mon P Wang
4f45512c23
It seems better to scalarize vectors of size 1 instead of widening them.
...
Add support to widen SETCC.
llvm-svn: 94342
2010-01-24 00:24:43 +00:00
Mon P Wang
586d997e98
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.
llvm-svn: 94338
2010-01-24 00:05:03 +00:00
Chris Lattner
d1acffc845
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.
llvm-svn: 94293
2010-01-23 06:17:14 +00:00
Eric Christopher
c1451d764f
Don't lower splat vector load to relative to the esp if the
...
stack may be misaligned.
Update test accordingly.
Patch by Evan Cheng!
llvm-svn: 94291
2010-01-23 06:02:43 +00:00
Chris Lattner
82b86b0fce
stop testing for invalid output.
...
llvm-svn: 94288
2010-01-23 05:45:28 +00:00
Chris Lattner
68eeb5ec9c
emit .ascii and .asciz through MCStreamer.
...
llvm-svn: 94282
2010-01-23 04:54:10 +00:00
Chris Lattner
cabb6ff64d
remove this test.
...
llvm-svn: 94276
2010-01-23 03:11:10 +00:00
Evan Cheng
8204911e1d
Fix test.
...
llvm-svn: 94272
2010-01-23 01:21:27 +00:00
Evan Cheng
e1b8b5a01b
Fix tests.
...
llvm-svn: 94271
2010-01-23 01:19:28 +00:00
Chris Lattner
88b8b1b419
make this less constrained, we want blank lines between globals.
...
llvm-svn: 94201
2010-01-22 19:51:08 +00:00
Dan Gohman
045f81981a
Revert LoopStrengthReduce.cpp to pre-r94061 for now.
...
llvm-svn: 94123
2010-01-22 00:46:49 +00:00
Chris Lattner
1526375827
testcase for r94095
...
llvm-svn: 94096
2010-01-21 20:01:04 +00:00
Dan Gohman
51ad99d2c5
Re-implement the main strength-reduction portion of LoopStrengthReduction.
...
This new version is much more aggressive about doing "full" reduction in
cases where it reduces register pressure, and also more aggressive about
rewriting induction variables to count down (or up) to zero when doing so
reduces register pressure.
It currently uses fairly simplistic algorithms for finding reuse
opportunities, but it introduces a new framework allows it to combine
multiple strategies at once to form hybrid solutions, instead of doing
all full-reduction or all base+index.
llvm-svn: 94061
2010-01-21 02:09:26 +00:00
Chris Lattner
f8dcf784a7
emit basic block labels with mcstreamer.
...
llvm-svn: 93993
2010-01-20 07:24:05 +00:00
Chris Lattner
4c8b1824f0
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
...
for tidiness.
llvm-svn: 93992
2010-01-20 07:19:19 +00:00
Chris Lattner
03cb2a3035
signficant cleanups to EmitGlobalConstant (including streamerization
...
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with
APValue::toStringUnsigned(S, 16).
llvm-svn: 93991
2010-01-20 07:11:32 +00:00
Dan Gohman
954f49014d
Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
...
that SCEVExpander can produce when running on behalf of LSR.
llvm-svn: 93949
2010-01-19 23:30:49 +00:00
Dan Gohman
221708d826
Make SCEVAddRecExpr's getType return a pointer type when the add
...
has a pointer member. This helps reduce unnecessary bitcasting
and uglygeps.
llvm-svn: 93939
2010-01-19 22:53:50 +00:00
Dan Gohman
fb9bea7150
Add nounwinds.
...
llvm-svn: 93919
2010-01-19 21:51:51 +00:00
Jakob Stoklund Olesen
bdc17f6840
Remove predicates when changing an add into an unpredicable mov.
...
Since the mov is executed unconditionally, make sure that the add didn't have
any predicate.
llvm-svn: 93909
2010-01-19 21:08:28 +00:00
Evan Cheng
bf43525a29
Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.
...
llvm-svn: 93895
2010-01-19 19:45:51 +00:00
Chris Lattner
a6368219ac
don't let asm-verbose break the check-next lines in these tests.
...
llvm-svn: 93869
2010-01-19 06:39:54 +00:00
Chris Lattner
c7a062d187
Now that we have everything nicely factored (e.g. asmprinter is not
...
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.
Some notes:
1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives. I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global. If .globl is
actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
before. If this is undesirable, it should explicitly opt out of these
things by clearing the relevant fields of MCAsmInfo.
This leads to a nice diffstat:
14 files changed, 127 insertions(+), 830 deletions(-)
llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Chris Lattner
a986aa33eb
fix a significant difference between llvm and gcc on ELF systems:
...
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits'
section. Fixing this will allow simplifications next up.
llvm-svn: 93844
2010-01-19 03:06:01 +00:00
Chris Lattner
024734e0f0
there is no need to emit a .section above .comm on linux.
...
llvm-svn: 93842
2010-01-19 02:46:56 +00:00
Evan Cheng
4668a3b935
Test case for r93758.
...
llvm-svn: 93824
2010-01-19 00:35:20 +00:00
Evan Cheng
88b65bc835
Canonicalize -1 - x to ~x.
...
Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore:
%t1 = sub i32 0, %a
%t2 = add i32 %t1, -1
The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A
will fold it to -1 - %a.
llvm-svn: 93773
2010-01-18 21:38:44 +00:00