Rafael Espindola
0324937229
Reduce code duplication on the TLS implementation.
...
This introduces a small regression on the generated code
quality in the case we are just computing addresses, not
loading values.
Will work on it and on X86-64 support.
llvm-svn: 68552
2009-04-07 21:37:46 +00:00
Dan Gohman
e98c3b1ea1
Don't attempt to handle aggregate argument values in FastISel; let
...
SelectionDAG do those. This fixes PR3955.
llvm-svn: 68546
2009-04-07 20:40:11 +00:00
Chris Lattner
2f520929d4
fix rdar://6762290, a crash compiling cxx filt with clang.
...
llvm-svn: 68500
2009-04-07 05:03:34 +00:00
Bob Wilson
39c7bec188
Handle 'a' modifier in ARM inline assembly.
...
Patch by Richard Pennington.
llvm-svn: 68464
2009-04-06 21:46:51 +00:00
Ed Schouten
ff25f858fd
Let the strcat optimizer return the pointer to the start of the buffer,
...
instead of the place where it started to perform the string copy.
- PR3661
- Patch by Benjamin Kramer!
llvm-svn: 68443
2009-04-06 13:06:48 +00:00
Nick Lewycky
811a7377b0
Try SSE2?
...
llvm-svn: 68423
2009-04-04 10:24:24 +00:00
Nick Lewycky
eea5412e19
Add support for embedded metadata to LLVM. This introduces two new types of
...
Constant, MDString and MDNode which can only be used by globals with a name
that starts with "llvm." or as arguments to a function with the same naming
restriction.
llvm-svn: 68420
2009-04-04 07:22:01 +00:00
Nick Lewycky
49df985ad9
Fix test on non-x86 platforms.
...
llvm-svn: 68419
2009-04-04 07:20:43 +00:00
Dan Gohman
ea48adc739
Fix a TargetLowering optimization so that it doesn't duplicate
...
loads when an input node has multiple uses.
llvm-svn: 68398
2009-04-03 20:11:30 +00:00
Mon P Wang
f829fb5cab
Added a x86 dag combine to increase the chances to use a
...
movq for v2i64 on x86-32.
llvm-svn: 68368
2009-04-03 02:43:30 +00:00
Owen Anderson
851ce6d1d5
Reapply r68211, with the miscompilations it caused fixed.
...
llvm-svn: 68262
2009-04-01 23:53:49 +00:00
Bob Wilson
5b42ebe6a9
Fix PR3862: Recognize some ARM-specific constraints for immediates in inline
...
assembly.
llvm-svn: 68218
2009-04-01 17:58:54 +00:00
Dan Gohman
a134448980
Revert r68172. It caused regressions in
...
Applications/Burg/burg
Applications/ClamAV/clamscan
and many other tests.
llvm-svn: 68211
2009-04-01 16:37:47 +00:00
Owen Anderson
d7c837bb4b
Enhance GVN to propagate simple conditionals. This fixes PR3921.
...
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
Evan Cheng
c419350132
Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
...
e.g.
define i32 @t1(i32 %c, i32 %x) nounwind {
%t1 = icmp eq i32 %c, 0
%t2 = lshr i32 %x, 18
%t3 = select i1 %t1, i32 %t2, i32 %x
ret i32 %t3
}
was turned into
define i32 @t2(i32 %c, i32 %x) nounwind {
%t1 = icmp eq i32 %c, 0
%t2 = select i1 %t1, i32 18, i32 0
%t3 = lshr i32 %x, %t2
ret i32 %t3
}
For most targets, that means materializing two constants and then a select. e.g. On x86-64
movl %esi, %eax
shrl $18, %eax
testl %edi, %edi
cmovne %esi, %eax
ret
=>
xorl %eax, %eax
testl %edi, %edi
movl $18, %ecx
cmovne %eax, %ecx
movl %esi, %eax
shrl %cl, %eax
ret
Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.
llvm-svn: 68142
2009-03-31 20:42:45 +00:00
Evan Cheng
0674a512bf
Fully general expansion of integer shift of any size.
...
llvm-svn: 68134
2009-03-31 19:39:24 +00:00
Dan Gohman
9f7d1f2bd4
Add an explicit -asm-verbose to these tests, to make it
...
possible to run the tests with -asm-verbose defaulting
to false.
llvm-svn: 68124
2009-03-31 18:20:47 +00:00
Devang Patel
7fa69ef109
Update call graph after inlining invoke.
...
Patch by Jay Foad.
llvm-svn: 68120
2009-03-31 17:36:12 +00:00
Owen Anderson
59cff6919d
Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
...
to account for this change.
llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Dan Gohman
cba99ee717
Fix live-out reg logic to not insert over-aggressive AssertZExt
...
instructions. This fixes lua.
llvm-svn: 68083
2009-03-31 01:38:29 +00:00
Devang Patel
ec65625744
Loop Index Split can eliminate a loop if it can determin if loop body is executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it.
...
llvm-svn: 68071
2009-03-30 22:24:10 +00:00
Evan Cheng
d7824e208a
Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
...
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0 = MOV %reg1025
If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.
llvm-svn: 68065
2009-03-30 21:34:07 +00:00
Anton Korobeynikov
497fd0e996
Tweak test for recent relro stuff
...
llvm-svn: 68035
2009-03-30 15:28:40 +00:00
Evan Cheng
5c460dbc3d
Forgot this test.
...
llvm-svn: 68025
2009-03-30 06:17:34 +00:00
Anton Korobeynikov
d24f576124
Testcase for recent ro/relocs stuff
...
llvm-svn: 68008
2009-03-29 17:14:57 +00:00
Duncan Sands
602234cdf3
Fix PR3899: add support for extracting floats from vectors
...
when using -soft-float.
Based on a patch by Jakob Stoklund Olesen.
llvm-svn: 67996
2009-03-29 13:51:06 +00:00
Arnold Schwaighofer
76188bc8a1
Make check in CheckTailCallReturnConstraints for ignorable instructions between
...
a CALL and a RET node more generic. Add a test for tail calls with a void
return.
llvm-svn: 67943
2009-03-28 12:36:29 +00:00
Arnold Schwaighofer
636127325b
Enable tail call optimization for functions that return a struct (bug 3664) and for functions that return types that need extending (e.g i1).
...
llvm-svn: 67934
2009-03-28 08:33:27 +00:00
Evan Cheng
a15fdaa292
Optimize some 64-bit multiplication by constants into two lea's or one lea + shl since imulq is slow (latency 5). e.g.
...
x * 40
=>
shlq $3, %rdi
leaq (%rdi,%rdi,4), %rax
This has the added benefit of allowing more multiply to be folded into addressing mode. e.g.
a * 24 + b
=>
leaq (%rdi,%rdi,2), %rax
leaq (%rsi,%rax,8), %rax
llvm-svn: 67917
2009-03-28 05:57:29 +00:00
Dan Gohman
66fc2f0a88
Fix this test so that it doesn't spuriously fail due to some
...
unrelated debugging output happening to contain the string "store".
llvm-svn: 67849
2009-03-27 16:17:22 +00:00
Evan Cheng
00b79de6a7
Add a __builtin___memset_chk test.
...
llvm-svn: 67815
2009-03-27 02:45:14 +00:00
Evan Cheng
86f6af35bf
Add -march=x86.
...
llvm-svn: 67783
2009-03-26 23:03:32 +00:00
Bill Wendling
e59b8d1cad
Add -f to RUN line.
...
llvm-svn: 67744
2009-03-26 06:17:54 +00:00
Chris Lattner
ad28e0de5f
no need for eh info
...
llvm-svn: 67740
2009-03-26 05:51:18 +00:00
Bill Wendling
3b9278a1c5
Add testcase for r67728.
...
llvm-svn: 67729
2009-03-26 01:52:47 +00:00
Devang Patel
8c31ea5290
Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
...
llvm-svn: 67719
2009-03-25 23:57:48 +00:00
Evan Cheng
bddc7d1032
Add a test case for PR3779: when to promote the function return value.
...
llvm-svn: 67702
2009-03-25 20:30:19 +00:00
Evan Cheng
7e4217176a
Revert 67132. This is breaking some objective-c apps.
...
Also fixes SDISel so it *does not* force promote return value if the function is not marked signext / zeroext.
llvm-svn: 67701
2009-03-25 20:20:11 +00:00
Evan Cheng
b5896c3c48
One more test.
...
llvm-svn: 67694
2009-03-25 17:45:18 +00:00
Evan Cheng
c288c3bf1a
Add __builtin___memcpy_chk tests.
...
llvm-svn: 67691
2009-03-25 16:49:31 +00:00
Duncan Sands
837d2365c1
These tests pass on linux.
...
llvm-svn: 67689
2009-03-25 16:43:59 +00:00
Evan Cheng
a51eea988c
Add a __builtin_object_size test.
...
llvm-svn: 67688
2009-03-25 16:29:33 +00:00
Chris Lattner
e7eed82209
Fix a bug in our autoupgrade support: in an argument list to a function
...
call, we should treat "i64 zext" as the start of a constant expr, but
"i64 0 zext" as an argument with an obsolete attribute on it (this form
is already tested by test/Assembler/2007-07-30-AutoUpgradeZextSext.ll).
Make the autoupgrade logic more discerning to avoid treating "i64 zext"
as an old-style attribute, causing us to reject a valid constant expr.
This fixes PR3876.
llvm-svn: 67682
2009-03-25 06:36:36 +00:00
Evan Cheng
3a7489a4cc
CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose.
...
llvm-svn: 67668
2009-03-25 01:47:28 +00:00
Chris Lattner
c055403764
Fix PR3874 by restoring a condition I removed, but making it more
...
precise than it used to be.
llvm-svn: 67662
2009-03-25 00:28:58 +00:00
Misha Brukman
6e86395ae7
Converted a1.ll to unittests.
...
llvm-svn: 67652
2009-03-24 21:36:09 +00:00
Chris Lattner
aabd3eeeff
canonicalize inttoptr and ptrtoint instructions which cast pointers
...
to/from integer types that are not intptr_t to convert to intptr_t
then do an integer conversion to the dest type. This exposes the
cast to the optimizer.
llvm-svn: 67638
2009-03-24 18:35:40 +00:00
Chris Lattner
51a4134e1c
two changes:
...
1. Make instcombine always canonicalize trunc x to i1 into an icmp(x&1). This
exposes the AND to other instcombine xforms and is more of what the code
generator expects.
2. Rewrite the remaining trunc pattern match to use 'match', which
simplifies it a lot.
llvm-svn: 67635
2009-03-24 18:15:30 +00:00
Dan Gohman
edd5fa3721
Add a testcase for the scheduling heuristic introduced in r67586.
...
llvm-svn: 67622
2009-03-24 16:38:27 +00:00
Evan Cheng
b3196f1298
Do not emit comments unless -asm-verbose.
...
llvm-svn: 67580
2009-03-24 00:17:40 +00:00