Chris Lattner
92c5c12bdb
move type name population out of TypePrinting class into a static
...
AsmWriter.cpp method.
llvm-svn: 65736
2009-02-28 23:20:19 +00:00
Chris Lattner
3339d7f8bc
switch to densemap for pointer->word map.
...
llvm-svn: 65735
2009-02-28 23:03:55 +00:00
Chris Lattner
b543cae7d6
delete a bunch of duplicated type printing logic, using the type printing
...
stuff in AsmWriter.cpp for Type::getDescription().
llvm-svn: 65734
2009-02-28 23:01:57 +00:00
Chris Lattner
63220af1ca
make this work when constructed with a null module*
...
llvm-svn: 65733
2009-02-28 23:01:30 +00:00
Chris Lattner
3ad4682b23
expose TypePrinting as a public API.
...
llvm-svn: 65729
2009-02-28 22:34:45 +00:00
Chris Lattner
06a2321051
rename 'Result' to 'OS' in CalcTypeName for consistency
...
llvm-svn: 65724
2009-02-28 21:27:31 +00:00
Chris Lattner
e101c44d77
do not embed the raw_ostream into TypePrinting, pass it as an argument to print etc.
...
llvm-svn: 65723
2009-02-28 21:26:53 +00:00
Chris Lattner
68318b1535
stop calling Type::getDescription().
...
llvm-svn: 65722
2009-02-28 21:18:43 +00:00
Chris Lattner
2ee62d28c1
simplifications
...
llvm-svn: 65721
2009-02-28 21:11:05 +00:00
Chris Lattner
24025261d3
Change WriteTypeSymbolic to not put a space out before types, also, remove
...
the old std::ostream version.
llvm-svn: 65720
2009-02-28 21:05:51 +00:00
Chris Lattner
40959d03cb
make CalcTypeName take a stream instead of a string to concat onto,
...
eliminate redundant opaque handling code.
llvm-svn: 65716
2009-02-28 20:49:40 +00:00
Chris Lattner
eb23f87289
remove a bunch of nearly-duplicated code.
...
llvm-svn: 65715
2009-02-28 20:40:29 +00:00
Chris Lattner
07d8829df9
fix indentation, remove dead integer case.
...
llvm-svn: 65714
2009-02-28 20:35:42 +00:00
Chris Lattner
765338decf
pull calcTypeName into TypePrinting class, make its type stack
...
be a smallvector instead of vector.
llvm-svn: 65713
2009-02-28 20:34:19 +00:00
Chris Lattner
7b394e87ff
inline method into its only use and simplify the result.
...
llvm-svn: 65712
2009-02-28 20:31:14 +00:00
Chris Lattner
1273471795
simplify condition
...
llvm-svn: 65711
2009-02-28 20:28:50 +00:00
Chris Lattner
0f57895708
start refactoring the .ll printer: introduce a new TypePrinting class
...
and move all related stuff to it.
llvm-svn: 65710
2009-02-28 20:25:14 +00:00
Chris Lattner
bb1fe8abdd
reject 0 element vectors with:
...
@a = internal constant void bitcast(<0 x i8> <> to void)
^
Fixes PR3685
llvm-svn: 65698
2009-02-28 18:12:41 +00:00
Evan Cheng
398dee1c4a
Last commit accidentially deleted this code.
...
llvm-svn: 65679
2009-02-28 06:02:14 +00:00
Mon P Wang
d844dc305e
Added another darwin subtarget
...
llvm-svn: 65662
2009-02-28 00:25:30 +00:00
Devang Patel
843cc34d81
It is possible that subprgoram definition is only encoding return value directly, instsad of an DIArray of all argument types.
...
llvm-svn: 65643
2009-02-27 18:05:21 +00:00
Rafael Espindola
000421eade
Refactor TLS code and add some tests. The tests and expected results are:
...
pic | declaration | linkage | visibility |
!pic | declaration | external | default | tls1.ll tls2.ll | local exec
pic | declaration | external | default | tls1-pic.ll tls2-pic.ll | general dynamic
!pic | !declaration | external | default | tls3.ll tls4.ll | initial exec
pic | !declaration | external | default | tls3-pic.ll tls4-pic.ll | general dynamic
!pic | declaration | external | hidden | tls7.ll tls8.ll | local exec
pic | declaration | external | hidden | X | local dynamic
!pic | !declaration | external | hidden | tls9.ll tls10.ll | local exec
pic | !declaration | external | hidden | X | local dynamic
!pic | declaration | internal | default | tls5.ll tls6.ll | local exec
pic | declaration | internal | default | X | local dynamic
The ones marked with an X have not been implemented since local dynamic is not implemented.
llvm-svn: 65632
2009-02-27 13:37:18 +00:00
Gabor Greif
bf4da856e4
Introduce a new technique for merging BasicBlock with Instruction sentinel by superposition.
...
This looks dangerous, but isn't because the sentinel is accessed in special way only,
namely the Next and Prev fields of it, and these are guaranteed to exist.
llvm-svn: 65626
2009-02-27 08:41:37 +00:00
Nick Lewycky
34709f84d8
Silence compiler warning about use of uninitialized variables (in reality these
...
are always set by reference on the path that uses them.) No functional change.
llvm-svn: 65621
2009-02-27 06:37:39 +00:00
Nick Lewycky
d05f6870c3
Fix compiler warning about uninitialized variables. No functional change.
...
llvm-svn: 65620
2009-02-27 06:29:31 +00:00
Dale Johannesen
4609dbe222
Alignment values for i64 and f64 on ppc64 were wrong,
...
possibly for the reason suggested by the comment.
No wonder it didn't work very well. This unblocks
bootstrap with assertions on ppc.
llvm-svn: 65601
2009-02-27 00:56:35 +00:00
Evan Cheng
8d0b4d4fd6
MachineLICM CSE should match destination register classes; avoid hoisting implicit_def's.
...
llvm-svn: 65592
2009-02-27 00:02:22 +00:00
Zhou Sheng
264e46e1e9
Ignore dbg info intrinsics when folding conditional branch to
...
conditional branch predecessors.
llvm-svn: 65509
2009-02-26 06:56:37 +00:00
Owen Anderson
5c53a46297
Enable stack slot coloring DCE. Evan's spiller fixes were needed before this could happen.
...
llvm-svn: 65501
2009-02-26 04:47:57 +00:00
Evan Cheng
40abb7b5d0
ADDS{D|S}rr_Int and MULS{D|S}rr_Int are not commutable. The users of these intrinsics expect the high bits will not be modified.
...
llvm-svn: 65499
2009-02-26 03:12:02 +00:00
Evan Cheng
ca2d65467b
The last commit was overly conservative. It's ok to reuse value that's already marked livein.
...
llvm-svn: 65498
2009-02-26 03:02:21 +00:00
Evan Cheng
ee5fd035e2
If an available register falls through to a succ block, unset the last kill. Sorry, it's impossible to reduce a sensible test case. It basically requires the moon and stars to align in order to cause a failure.
...
llvm-svn: 65497
2009-02-26 02:30:42 +00:00
Evan Cheng
a49de9de2e
Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.
...
llvm-svn: 65482
2009-02-25 22:49:59 +00:00
Dale Johannesen
7d12ea0f62
Fix big-endian codegen bug. We're splitting up
...
overly long ints, e.g. i96, into pieces at PHIs
and the nodes that feed into them; however big-endian
reverses the order of the pieces (for some reason), and
wasn't doing it the same way on both sides, so
the pieces didn't match and runtime failures ensued.
Fixes 188.ammp and sqlite3 on ppc32.
llvm-svn: 65481
2009-02-25 22:39:13 +00:00
Devang Patel
7e7fa83f6e
Print variable's display name in dwarf DIE.
...
llvm-svn: 65468
2009-02-25 19:41:35 +00:00
Chris Lattner
af618171f4
Fix PR3667
...
llvm-svn: 65464
2009-02-25 18:20:01 +00:00
Zhou Sheng
5d9cc1763b
Don't block basic block with only SwitchInst to fold into predecessors.
...
llvm-svn: 65456
2009-02-25 15:34:27 +00:00
Evan Cheng
86673f2806
Clean up dwarf writer, part 1. This eliminated the horrible recursive getGlobalVariablesUsing and replaced it something readable. It eliminated use of slow UniqueVector and replaced it with StringMap, SmallVector, and DenseMap, etc. It also fixed some non-deterministic behavior.
...
This is a very minor compile time win.
llvm-svn: 65438
2009-02-25 07:04:34 +00:00
Nick Lewycky
5c10a3aa7f
Add a totally synthetic situation I came up with while looking at a bug in
...
related code.
llvm-svn: 65437
2009-02-25 06:52:48 +00:00
Scott Michel
e2fdc31759
Expand tabs to spaces (overlooked in previous commit)
...
llvm-svn: 65427
2009-02-25 03:57:49 +00:00
Scott Michel
bb878288cb
Remove all "cached" data from BuildVectorSDNode, preferring to retrieve
...
results via reference parameters.
This patch also appears to fix Evan's reported problem supplied as a
reduced bugpoint test case.
llvm-svn: 65426
2009-02-25 03:12:50 +00:00
Mon P Wang
b402493161
Added support to have TableGen provide information if an intrinsic (core
...
or target) can be overloaded or not.
llvm-svn: 65404
2009-02-24 23:17:49 +00:00
Devang Patel
0c83e84f40
If compile unit's language is not set then don't crash while dump'ing compile unit.
...
llvm-svn: 65402
2009-02-24 23:15:09 +00:00
Daniel Dunbar
5bf00893b6
Extension of GEP in constant folder was broken (apparently this code
...
has never been run!).
- Sorry, don't know how to make an LLVM test case for this.
llvm-svn: 65383
2009-02-24 19:10:46 +00:00
Dan Gohman
0bddac16a8
Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,
...
to more accurately describe what it does. Expand its doxygen comment
to describe what the backedge-taken count is and how it differs
from the actual iteration count of the loop. Adjust names and
comments in associated code accordingly.
llvm-svn: 65382
2009-02-24 18:55:53 +00:00
Bill Wendling
c5437ea429
Overhaul my earlier submission due to feedback. It's a large patch, but most of
...
them are generic changes.
- Use the "fast" flag that's already being passed into the asm printers instead
of shoving it into the DwarfWriter.
- Instead of calling "MI->getParent()->getParent()" for every MI, set the
machine function when calling "runOnMachineFunction" in the asm printers.
llvm-svn: 65379
2009-02-24 08:30:20 +00:00
Owen Anderson
0fb12efbc1
Add a debugging option for SSC DCE.
...
llvm-svn: 65375
2009-02-24 05:44:18 +00:00
Bill Wendling
786c5973f7
- Use the "Fast" flag instead of "OptimizeForSize" to determine whether to emit
...
a DBG_LABEL or not. We want to fall back to the original way of emitting debug
info when we're in -O0/-fast mode.
- Add plumbing in to pass the "Fast" flag to places that need it.
- XFAIL DebugInfo/deaddebuglabel.ll. This is finding 11 labels instead of 8. I
need to investigate still.
llvm-svn: 65367
2009-02-24 02:35:30 +00:00
Dan Gohman
4f356bb9b0
Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple
...
ashr instcombine to help expose this code. And apply the fix to
SelectionDAG's copy of this code too.
llvm-svn: 65364
2009-02-24 02:00:40 +00:00
Dan Gohman
5d1f458f0f
Generalize the ChangeCompareStride code, in preparation for
...
handling non-constant strides. No functionality change.
llvm-svn: 65363
2009-02-24 01:58:00 +00:00
Dan Gohman
e669884749
Preserve the DominanceFrontier analysis in the LoopDeletion pass.
...
llvm-svn: 65359
2009-02-24 01:21:53 +00:00
Devang Patel
50c6324119
gdb uses DW_AT_prototyped to identify K&R style in C based languages.
...
This fixes objc.dg/dwarf-prototypes.m scan-assembler DW_AT_prototyped from llvmgcc42 test suite.
llvm-svn: 65357
2009-02-24 00:52:19 +00:00
Devang Patel
e288082644
While folding unconditional return move DbgRegionEndInst into the predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite.
...
gcc.c-torture/execute/20000605-3.c
gcc.c-torture/execute/20020619-1.c
gcc.c-torture/execute/20030920-1.c
gcc.c-torture/execute/loop-ivopts-1.c
llvm-svn: 65353
2009-02-24 00:05:16 +00:00
Devang Patel
6ced076e4c
If there is not any debug info available for any global variables and any subprograms then there is not any debug info to emit.
...
llvm-svn: 65352
2009-02-24 00:02:15 +00:00
Dan Gohman
f6e8c77e1c
Back out the change in 64918 that used sign-extensions when promoting
...
trip counts that use signed comparisons. It's not obviously the best
approach for preserving trip count information, and at any rate there
isn't anything in the tree right now that makes use of that, so for
now always using zero-extensions is preferable.
llvm-svn: 65347
2009-02-23 23:20:35 +00:00
Dan Gohman
318d7376ba
Fast-isel can't do TLS yet, so it should fall back to SDISel
...
if it sees TLS addresses.
llvm-svn: 65341
2009-02-23 22:03:08 +00:00
Dan Gohman
e591411fd6
LoopDeletion needs to inform ScalarEvolution when a loop is deleted,
...
so that ScalarEvolution doesn't hang onto a dangling Loop*, which
could be a problem if another Loop happens to get allocated at the
same address.
llvm-svn: 65323
2009-02-23 17:10:29 +00:00
Dan Gohman
42987f528a
IndVarSimplify preserves ScalarEvolution. In the
...
-std-compile-opts sequence, this avoids the need for ScalarEvolution to
be rerun before LoopDeletion.
llvm-svn: 65318
2009-02-23 16:29:41 +00:00
Zhou Sheng
3a86bcf134
Should reset DBI_Prev if DBI_Next == 0.
...
llvm-svn: 65314
2009-02-23 10:14:11 +00:00
Evan Cheng
9f8fddeed8
Only v1i16 (i.e. _m64) is returned via RAX / RDX.
...
llvm-svn: 65313
2009-02-23 09:03:22 +00:00
Nate Begeman
e684da3e5d
Generate better code for v8i16 shuffles on SSE2
...
Generate better code for v16i8 shuffles on SSE2 (avoids stack)
Generate pshufb for v8i16 and v16i8 shuffles on SSSE3 where it is fewer uops.
Document the shuffle matching logic and add some FIXMEs for later further
cleanups.
New tests that test the above.
Examples:
New:
_shuf2:
pextrw $7, %xmm0, %eax
punpcklqdq %xmm1, %xmm0
pshuflw $128, %xmm0, %xmm0
pinsrw $2, %eax, %xmm0
Old:
_shuf2:
pextrw $2, %xmm0, %eax
pextrw $7, %xmm0, %ecx
pinsrw $2, %ecx, %xmm0
pinsrw $3, %eax, %xmm0
movd %xmm1, %eax
pinsrw $4, %eax, %xmm0
ret
=========
New:
_shuf4:
punpcklqdq %xmm1, %xmm0
pshufb LCPI1_0, %xmm0
Old:
_shuf4:
pextrw $3, %xmm0, %eax
movsd %xmm1, %xmm0
pextrw $3, %xmm1, %ecx
pinsrw $4, %ecx, %xmm0
pinsrw $5, %eax, %xmm0
========
New:
_shuf1:
pushl %ebx
pushl %edi
pushl %esi
pextrw $1, %xmm0, %eax
rolw $8, %ax
movd %xmm0, %ecx
rolw $8, %cx
pextrw $5, %xmm0, %edx
pextrw $4, %xmm0, %esi
pextrw $3, %xmm0, %edi
pextrw $2, %xmm0, %ebx
movaps %xmm0, %xmm1
pinsrw $0, %ecx, %xmm1
pinsrw $1, %eax, %xmm1
rolw $8, %bx
pinsrw $2, %ebx, %xmm1
rolw $8, %di
pinsrw $3, %edi, %xmm1
rolw $8, %si
pinsrw $4, %esi, %xmm1
rolw $8, %dx
pinsrw $5, %edx, %xmm1
pextrw $7, %xmm0, %eax
rolw $8, %ax
movaps %xmm1, %xmm0
pinsrw $7, %eax, %xmm0
popl %esi
popl %edi
popl %ebx
ret
Old:
_shuf1:
subl $252, %esp
movaps %xmm0, (%esp)
movaps %xmm0, 16(%esp)
movaps %xmm0, 32(%esp)
movaps %xmm0, 48(%esp)
movaps %xmm0, 64(%esp)
movaps %xmm0, 80(%esp)
movaps %xmm0, 96(%esp)
movaps %xmm0, 224(%esp)
movaps %xmm0, 208(%esp)
movaps %xmm0, 192(%esp)
movaps %xmm0, 176(%esp)
movaps %xmm0, 160(%esp)
movaps %xmm0, 144(%esp)
movaps %xmm0, 128(%esp)
movaps %xmm0, 112(%esp)
movzbl 14(%esp), %eax
movd %eax, %xmm1
movzbl 22(%esp), %eax
movd %eax, %xmm2
punpcklbw %xmm1, %xmm2
movzbl 42(%esp), %eax
movd %eax, %xmm1
movzbl 50(%esp), %eax
movd %eax, %xmm3
punpcklbw %xmm1, %xmm3
punpcklbw %xmm2, %xmm3
movzbl 77(%esp), %eax
movd %eax, %xmm1
movzbl 84(%esp), %eax
movd %eax, %xmm2
punpcklbw %xmm1, %xmm2
movzbl 104(%esp), %eax
movd %eax, %xmm1
punpcklbw %xmm1, %xmm0
punpcklbw %xmm2, %xmm0
movaps %xmm0, %xmm1
punpcklbw %xmm3, %xmm1
movzbl 127(%esp), %eax
movd %eax, %xmm0
movzbl 135(%esp), %eax
movd %eax, %xmm2
punpcklbw %xmm0, %xmm2
movzbl 155(%esp), %eax
movd %eax, %xmm0
movzbl 163(%esp), %eax
movd %eax, %xmm3
punpcklbw %xmm0, %xmm3
punpcklbw %xmm2, %xmm3
movzbl 188(%esp), %eax
movd %eax, %xmm0
movzbl 197(%esp), %eax
movd %eax, %xmm2
punpcklbw %xmm0, %xmm2
movzbl 217(%esp), %eax
movd %eax, %xmm4
movzbl 225(%esp), %eax
movd %eax, %xmm0
punpcklbw %xmm4, %xmm0
punpcklbw %xmm2, %xmm0
punpcklbw %xmm3, %xmm0
punpcklbw %xmm1, %xmm0
addl $252, %esp
ret
llvm-svn: 65311
2009-02-23 08:49:38 +00:00
Mon P Wang
dccfa0b26c
Changed option name from inline-threshold to basic-inline-threshold because
...
inline-threshold option is used by the inliner.
llvm-svn: 65309
2009-02-23 07:07:56 +00:00
Chris Lattner
d5420f0957
fix some typos that Duncan noticed
...
llvm-svn: 65306
2009-02-23 05:56:17 +00:00
Bill Wendling
9ee052bcdc
Propagate debug loc info through prologue/epilogue.
...
llvm-svn: 65298
2009-02-23 00:42:30 +00:00
Scott Michel
9d31aca679
Introduce the BuildVectorSDNode class that encapsulates the ISD::BUILD_VECTOR
...
instruction. The class also consolidates the code for detecting constant
splats that's shared across PowerPC and the CellSPU backends (and might be
useful for other backends.) Also introduces SelectionDAG::getBUID_VECTOR() for
generating new BUILD_VECTOR nodes.
llvm-svn: 65296
2009-02-22 23:36:09 +00:00
Dan Gohman
648c5e9c99
Revert the part of 64623 that attempted to align the source in a
...
memcpy to match the alignment of the destination. It isn't necessary
for making loads and stores handled like the SSE loadu/storeu
intrinsics, and it was causing a performance regression in
MultiSource/Applications/JM/lencod.
The problem appears to have been a memcpy that copies from some
highly aligned array into an alloca; the alloca was then being
assigned a large alignment, which required codegen to perform
dynamic stack-pointer re-alignment, which forced the enclosing
function to have a frame pointer, which led to increased spilling.
llvm-svn: 65289
2009-02-22 18:06:32 +00:00
Dan Gohman
f394e58af5
Properly parenthesize this expression, fixing a real bug in the new
...
-full-lsr code, as well as a GCC warning.
llvm-svn: 65288
2009-02-22 16:40:52 +00:00
Evan Cheng
e779595af0
If a use operand is marked isKill, don't forget to add kill to its live interval as well.
...
llvm-svn: 65279
2009-02-22 08:35:56 +00:00
Evan Cheng
2448aa1d8d
Add a note.
...
llvm-svn: 65275
2009-02-22 08:13:45 +00:00
Evan Cheng
e4ffc030e2
Be bug compatible with gcc by returning MMX values in RAX.
...
llvm-svn: 65274
2009-02-22 08:05:12 +00:00
Evan Cheng
91193c0094
Do not consider MMX_MOVD64rr a move instructions. The source register is in GR32, the destination is VR64. They are not compatible.
...
llvm-svn: 65273
2009-02-22 08:04:23 +00:00
Evan Cheng
69decbf0b2
Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field.
...
llvm-svn: 65268
2009-02-22 07:31:19 +00:00
Nick Lewycky
d44e80d7fc
Don't sign extend the char when expanding char -> int during
...
load(bitcast(char[4] to i32*)) evaluation.
llvm-svn: 65246
2009-02-21 20:50:42 +00:00
Richard Pennington
99f6d7c9fc
bug 3610: Floating point vaarg not softened.
...
llvm-svn: 65239
2009-02-21 19:11:18 +00:00
Anton Korobeynikov
42aae86590
Drop bunch of half-working stuff in the ext_weak linkage support.
...
Now we're using one gross, but quite robust hack :) (previous ones
did not work, for example, when ext_weak symbol was used deep inside
constant expression in the initializer).
The proper fix of this problem will require some quite huge asmprinter
changes and that's why was postponed. This fixes PR3629 by the way :)
llvm-svn: 65230
2009-02-21 11:53:32 +00:00
Evan Cheng
1173ec7a2e
Add AddrModeMatcher.cpp
...
llvm-svn: 65228
2009-02-21 07:05:11 +00:00
Evan Cheng
34806b1fa4
If two-address def is dead and the instruction does not define other registers, and it doesn't produce side effects, just delete the instruction.
...
llvm-svn: 65218
2009-02-21 03:14:25 +00:00
Evan Cheng
107b06c4b9
Teach LSR sink to sink the immediate portion of the common expression back into uses if they fit in address modes of all the uses.
...
llvm-svn: 65215
2009-02-21 02:06:47 +00:00
Bill Wendling
82aa14fae8
Make sure this doesn't access .end() too.
...
llvm-svn: 65213
2009-02-21 01:11:36 +00:00
Bill Wendling
81ebf9a578
Make sure we don't dereference the .end() of the container.
...
llvm-svn: 65211
2009-02-21 01:07:26 +00:00
Chris Lattner
bef6b2098e
rename a function to indicate that it checks for profitability as well
...
as legality. Make load sinking and gep sinking more careful: we only
do it when it won't pessimize loads from the stack. This has the added
benefit of not producing code that is unanalyzable to SROA.
llvm-svn: 65209
2009-02-21 00:46:50 +00:00
Bill Wendling
56759ee658
Propagate more debug loc infos. This also includes some code cleaning.
...
llvm-svn: 65207
2009-02-21 00:43:56 +00:00
Bill Wendling
5191934371
We need to propagate the debug location information even when dealing with the
...
prologue/epilogue.
llvm-svn: 65206
2009-02-21 00:32:08 +00:00
Dan Gohman
e7fe80fcf9
Fix a bug that David Greene found in the DAGCombiner's logic
...
that checks whether it's safe to transform a store of a bitcast
value into a store of the original value.
llvm-svn: 65201
2009-02-20 23:29:13 +00:00
Evan Cheng
8a9481d50d
Fix strange logic in CollectIVUsers used to determine whether all uses are
...
addresses, part 1. This fixes an obvious logic bug. Previously if the only
in-loop use is a PHI, it would return AllUsesAreAddresses as true.
llvm-svn: 65178
2009-02-20 22:16:49 +00:00
Dan Gohman
5e309a5bbb
Simplify code and reduce indentation. No functionality change.
...
llvm-svn: 65167
2009-02-20 21:27:23 +00:00
Dan Gohman
2c8cb5b4ec
Fix 80-column violations.
...
llvm-svn: 65159
2009-02-20 21:06:57 +00:00
Dan Gohman
addc50b4ee
It's not necessary to check if Base is null here.
...
llvm-svn: 65157
2009-02-20 21:05:23 +00:00
Evan Cheng
2a9bad5ac1
Support return of MMX values in 64-bit mode.
...
llvm-svn: 65152
2009-02-20 20:43:02 +00:00
Bill Wendling
2343339644
- Early exit a nested block.
...
- Correct comment.
- Whitespace changes.
llvm-svn: 65149
2009-02-20 20:40:28 +00:00
Dan Gohman
1608df5319
Add a comment about how Imm can be used for loop-variant values.
...
llvm-svn: 65147
2009-02-20 20:29:04 +00:00
Torok Edwin
87d5ca083b
add note about sin
...
llvm-svn: 65137
2009-02-20 18:42:06 +00:00
Evan Cheng
c380864d2c
Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
...
llvm-svn: 65134
2009-02-20 18:24:38 +00:00
Zhou Sheng
053737e1ae
Just roll back the previous change to -mem2reg.
...
Will re-think about this according to Chris's comments.
llvm-svn: 65126
2009-02-20 17:49:33 +00:00
Zhou Sheng
6a0634d423
patch to update the line number information in pass -mem2reg.
...
Currently this pass will delete the variable declaration info,
and keep the line number info. But the kept line number info is not updated,
and some is redundant or not correct, this patch just updates those info.
llvm-svn: 65123
2009-02-20 16:31:35 +00:00
Owen Anderson
f13820148b
Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
...
llvm-svn: 65121
2009-02-20 10:02:23 +00:00
Owen Anderson
81db491b7f
Add a quick pass to the stack slot colorer to eliminate some trivially redundant spills after coloring.
...
Ideally these would never get created in the first place, but until we enhance the spiller to have a more
global picture of what's happening, this is necessary for code quality in some circumstances.
llvm-svn: 65120
2009-02-20 09:11:36 +00:00
Dan Gohman
2a12ae7d1f
Implement "superhero" strength reduction, or full strength
...
reduction of address calculations down to basic pointer arithmetic.
This is currently off by default, as it needs a few other features
before it becomes generally useful. And even when enabled, full
strength reduction is only performed when it doesn't increase
register pressure, and when several other conditions are true.
This also factors out a bunch of exisiting LSR code out of
StrengthReduceStridedIVUsers into separate functions, and tidies
up IV insertion. This actually decreases register pressure even
in non-superhero mode. The change in iv-users-in-other-loops.ll
is an example of this; there are two more adds because there are
two fewer leas, and there is less spilling.
llvm-svn: 65108
2009-02-20 04:17:46 +00:00
Bill Wendling
0a0987d198
Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
...
llvm-svn: 65092
2009-02-20 00:44:43 +00:00
Bill Wendling
7b9f38ad37
Temporarily revert r65065. It was causing test failures.
...
llvm-svn: 65068
2009-02-19 21:57:07 +00:00
Bill Wendling
1a0a3d0ff5
Print out debug info when printing the machine instruction.
...
llvm-svn: 65067
2009-02-19 21:44:55 +00:00
Bill Wendling
df78dcc0b2
Check for -fast here too.
...
llvm-svn: 65065
2009-02-19 21:23:54 +00:00
Bill Wendling
19e0a5b3c3
Generate these labels when we're in "fast" mode, not simply when we're no in
...
"optimize-for-size" mode.
llvm-svn: 65064
2009-02-19 21:12:54 +00:00
Dan Gohman
a34d7adefb
Use DEBUG() instead of passing *DOUT to WriteAsOperand,
...
since the latter just passes a null reference when
debugging is not enabled.
llvm-svn: 65060
2009-02-19 19:32:06 +00:00
Dan Gohman
30a2959367
Make the debug output of LSR less cryptic and more informative.
...
llvm-svn: 65057
2009-02-19 19:23:27 +00:00
Chris Lattner
3c50fdf4ca
If an executable is run through a symlink, dladdr will return the
...
symlink. We really want the ultimate executable being run, not
the symlink. This lets clang find its headers when invoked through
a symlink. rdar://6602012
llvm-svn: 65017
2009-02-19 05:34:35 +00:00
Dan Gohman
c0ae249b22
Fix the logic in this assertion to properly validate the number
...
of arguments.
llvm-svn: 64999
2009-02-19 02:55:18 +00:00
Dan Gohman
6c109b4979
Reapply r57340. VMKit does not presently rely on materializeFunction
...
being called with the lock released, and this fixes a race condition
in the JIT as used by lli.
llvm-svn: 64997
2009-02-19 02:40:15 +00:00
Bill Wendling
0f4c581c4a
Put code that generates debug labels into TableGen so that it can be used by
...
everyone.
llvm-svn: 64978
2009-02-18 23:12:06 +00:00
Chris Lattner
778c62ccb5
add proper asmwriter and asmparser support for anonymous functions.
...
llvm-svn: 64953
2009-02-18 21:48:13 +00:00
Duncan Sands
7a1db33e77
In theory the aliasee may have dead constant users
...
here. Since we only do the transform if there is
one use, strip off any such users in the hope of
making the transform fire more often.
llvm-svn: 64926
2009-02-18 17:55:38 +00:00
Devang Patel
66c5a1dd50
The subprogram die may not exist while creating "default" scope.
...
llvm-svn: 64920
2009-02-18 17:29:38 +00:00
Dan Gohman
8078b8bddc
Use a sign-extend instead of a zero-extend when promoting a
...
trip count value when the original loop iteration condition is
signed and the canonical induction variable won't undergo signed
overflow. This isn't required for correctness; it just preserves
more information about original loop iteration values.
Add a getTruncateOrSignExtend method to ScalarEvolution,
following getTruncateOrZeroExtend.
llvm-svn: 64918
2009-02-18 17:22:41 +00:00
Dan Gohman
aa0f01929b
Simplify by using dyn_cast instead of isa and cast.
...
llvm-svn: 64917
2009-02-18 16:54:33 +00:00
Dan Gohman
8cab4c44bb
Add explicit keywords.
...
llvm-svn: 64915
2009-02-18 16:37:45 +00:00
Nate Begeman
18d85e7403
Add support to the JIT for true non-lazy operation. When a call to a function
...
that has not been JIT'd yet, the callee is put on a list of pending functions
to JIT. The call is directed through a stub, which is updated with the address
of the function after it has been JIT'd. A new interface for allocating and
updating empty stubs is provided.
Add support for removing the ModuleProvider the JIT was created with, which
would otherwise invalidate the JIT's PassManager, which is initialized with the
ModuleProvider's Module.
Add support under a new ExecutionEngine flag for emitting the infomration
necessary to update Function and GlobalVariable stubs after JITing them, by
recording the address of the stub and the name of the GlobalValue. This allows
code to be copied from one address space to another, where libraries may live
at different virtual addresses, and have the stubs updated with their new
correct target addresses.
llvm-svn: 64906
2009-02-18 08:31:02 +00:00
Dan Gohman
2af1f85f1f
Factor out the code to add a MachineOperand to a MachineInstrBuilder.
...
llvm-svn: 64891
2009-02-18 05:45:50 +00:00
Dan Gohman
38a9631d5f
Eliminate several more unnecessary intptr_t casts.
...
llvm-svn: 64888
2009-02-18 05:09:16 +00:00
Evan Cheng
a40d5e14ab
GV with null value initializer shouldn't go to BSS if it's meant for a mergeable strings section. Currently it only checks for Darwin. Someone else please check if it should apply to other targets as well.
...
llvm-svn: 64877
2009-02-18 02:19:52 +00:00
Dan Gohman
8212ebb5cf
Fix a corner case in the new indvars promotion logic: if there
...
are multiple IV's in a loop, some of them may under go signed
or unsigned wrapping even if the IV that's used in the loop
exit condition doesn't. Restrict sign-extension-elimination
and zero-extension-elimination to only those that operate on
the original loop-controlling IV.
llvm-svn: 64866
2009-02-18 00:52:00 +00:00
Dan Gohman
d0b1fbd983
Fix a typo in a comment.
...
llvm-svn: 64859
2009-02-18 00:08:39 +00:00
Duncan Sands
bf3ba5a1e9
If an alias is dead and so is its aliasee, then globaldce would
...
crash because the alias would still be using the aliasee when the
aliasee was deleted.
llvm-svn: 64844
2009-02-17 23:05:26 +00:00
Devang Patel
4d20395a5f
The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.
...
Add support for two additional DWARF attributes to encode Objective-C runtime version number.
llvm-svn: 64834
2009-02-17 22:43:44 +00:00
Scott Michel
cf0da6c597
Remove trailing whitespace to reduce later commit patch noise.
...
(Note: Eventually, commits like this will be handled via a pre-commit hook that
does this automagically, as well as expand tabs to spaces and look for 80-col
violations.)
llvm-svn: 64827
2009-02-17 22:15:04 +00:00
Devang Patel
528987a1e8
Emit debug info for bitfields.
...
llvm-svn: 64815
2009-02-17 21:23:59 +00:00
Dan Gohman
d90415555e
LoopIndexSplit doesn't actually use ScalarEvolution.
...
llvm-svn: 64811
2009-02-17 20:50:11 +00:00
Dan Gohman
4330034160
Add a method to ScalarEvolution for telling it when a loop has been
...
modified in a way that may effect the trip count calculation. Change
IndVars to use this method when it rewrites pointer or floating-point
induction variables instead of using a doInitialization method to
sneak these changes in before ScalarEvolution has a chance to see
the loop. This eliminates the need for LoopPass to depend on
ScalarEvolution.
llvm-svn: 64810
2009-02-17 20:49:49 +00:00
Chris Lattner
24f31a0e59
commit a tweaked version of Daniel's patch for PR3599. We now
...
eliminate all the extensions and all but the one required truncate
from the testcase, but the or/and/shift stuff still isn't zapped.
llvm-svn: 64809
2009-02-17 20:47:23 +00:00
Dan Gohman
143206d07b
Move dumpPassStructure out of line.
...
llvm-svn: 64796
2009-02-17 19:41:26 +00:00
Dan Gohman
f84d42f282
Delete trailing whitespace.
...
llvm-svn: 64784
2009-02-17 19:13:57 +00:00
Duncan Sands
f974c5703c
This transform also applies to private linkage.
...
llvm-svn: 64773
2009-02-17 17:50:04 +00:00
Dan Gohman
efe65e547b
Fix 80-column violation.
...
llvm-svn: 64766
2009-02-17 15:57:39 +00:00
Evan Cheng
f505cd5ebb
A couple of places where reused use operands should be marked kill. This is exposed by recent availability fallthrough changes.
...
llvm-svn: 64745
2009-02-17 06:41:03 +00:00
Chris Lattner
cba4b6f83d
add a horrible note
...
llvm-svn: 64719
2009-02-17 01:16:14 +00:00
Bill Wendling
3c50922ea0
--- Merging (from foreign repository) r64714 into '.':
...
U include/llvm/CodeGen/DebugLoc.h
U lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Enable debug location generation at -Os. This goes with the reapplication of the
r63639 patch.
llvm-svn: 64715
2009-02-17 01:04:54 +00:00
Evan Cheng
161861deb0
Strengthen the "non-constant stride must dominate loop preheader" check.
...
llvm-svn: 64703
2009-02-17 00:13:06 +00:00
Dan Gohman
2cd8982002
Simplify; fix some 80-column violations.
...
llvm-svn: 64702
2009-02-17 00:10:53 +00:00
Dan Gohman
2a4553ba5f
Delete trailing whitespace.
...
llvm-svn: 64694
2009-02-16 23:14:14 +00:00
Dan Gohman
f68d29edd5
Fix EnforceKnownAlignment so that it doesn't ever reduce the alignment
...
of an alloca or global variable.
llvm-svn: 64693
2009-02-16 23:02:21 +00:00
Nick Lewycky
0f269cfdee
Fix typo caused by too much surfing, dudes...
...
llvm-svn: 64626
2009-02-16 04:26:53 +00:00
Dan Gohman
136aa1fb96
Delete this long-commented-out code. The situation it seems to have
...
been written for is no longer relevant with the elimination of
signed and unsigned types.
llvm-svn: 64625
2009-02-16 02:57:42 +00:00
Dan Gohman
9cdfd44521
Change these tests to use regular loads instead of llvm.x86.sse2.loadu.dq.
...
Enhance instcombine to use the preferred field of
GetOrEnforceKnownAlignment in more cases, so that regular IR operations are
optimized in the same way that the intrinsics currently are.
llvm-svn: 64623
2009-02-16 00:44:23 +00:00
Dan Gohman
aaee6c9523
Don't assume that a left-shift of a value with one bit set will have
...
one bit set, because the bit may be shifted off the end. Instead,
just check for a constant 1 being shifted. This is still sufficient
to handle all the cases in test/CodeGen/X86/bt.ll. This fixes PR3583.
llvm-svn: 64622
2009-02-15 23:59:32 +00:00
Dan Gohman
f6ccacba36
MachineLICM now handles these cases.
...
llvm-svn: 64620
2009-02-15 23:24:52 +00:00
Nick Lewycky
8f4a097f15
Update the list of function annotations for nocapture. All of these came up
...
when I was looking at functions used by python.
Highlights include, better largefile support (64-bit file sizes on 32-bit
systems), fputs string is nocapture, popen/pclose added (popen being noalias
return), modf and frexp and friends. Also added some missing 'break' statements
and combined identical sections.
llvm-svn: 64615
2009-02-15 22:47:25 +00:00
Nicolas Geoffray
7f543ba9fa
On 64bit we may have a personality function which requires 64 bits to
...
be encoded.
llvm-svn: 64600
2009-02-15 20:49:23 +00:00
Duncan Sands
46196aef82
Make this more useful for cleaning up after the
...
one-definition-rule llvm-gcc changes (coming soon
to a tree near you!).
llvm-svn: 64588
2009-02-15 11:54:49 +00:00
Duncan Sands
b3f27881a9
If the target of an alias has internal linkage, then the
...
alias can be morphed into the target. Implement this
transform, and fix a crash in the existing transform at
the same time.
llvm-svn: 64583
2009-02-15 09:56:08 +00:00
Evan Cheng
2510436e20
Fix PR3522. It's not safe to sink into landing pad BB's.
...
llvm-svn: 64582
2009-02-15 08:36:12 +00:00
Evan Cheng
e79841adbb
Fix pr3571: If stride is a value defined by an instruction, make sure it dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation.
...
llvm-svn: 64579
2009-02-15 06:06:15 +00:00
Evan Cheng
fe151ba135
ifdef out unneeded if statement.
...
llvm-svn: 64575
2009-02-15 03:20:37 +00:00
Mikhail Glushenkov
58a1a8e546
Fix warning on gcc 4.3.
...
"system() declared with attribute warn_unused_result."
llvm-svn: 64574
2009-02-15 03:20:32 +00:00
Mikhail Glushenkov
a539836b95
Whitespace fixes.
...
llvm-svn: 64573
2009-02-15 03:20:03 +00:00
Cedric Venet
d1e179d992
Unbreak the build on win32.
...
Cleanup some warning.
Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.
Only tested with VS2008. hope it does not break anything. feel free to revert.
llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Duncan Sands
73247d2edc
Generalize some alias analysis logic from atomic
...
intrinsics to any IntrWriteArgMem intrinsics.
llvm-svn: 64551
2009-02-14 10:56:35 +00:00
Dan Gohman
29705333e5
The x86-64 red zone is now being used.
...
llvm-svn: 64535
2009-02-14 03:30:05 +00:00
Dan Gohman
671f2c085f
Extend the IndVarSimplify support for promoting induction variables:
...
- Test for signed and unsigned wrapping conditions, instead of just
testing for non-negative induction ranges.
- Handle loops with GT comparisons, in addition to LT comparisons.
- Support more cases of induction variables that don't start at 0.
llvm-svn: 64532
2009-02-14 02:31:09 +00:00
Dan Gohman
47ff6aad23
Clarify debug output.
...
llvm-svn: 64531
2009-02-14 02:26:50 +00:00
Dan Gohman
4bfa1d4c63
Simplify some code. hasComputableLoopEvolution is overkill in this case.
...
No functionality change.
llvm-svn: 64530
2009-02-14 02:25:19 +00:00
Evan Cheng
c2fde91703
Teach x86 target -soft-float.
...
llvm-svn: 64496
2009-02-13 22:36:38 +00:00
Dan Gohman
55ea72179c
In CodeGenPrepare's debug output, use WriteAsOperand instead of
...
printing getName(), so that unnamed values are printed correctly.
llvm-svn: 64468
2009-02-13 17:45:12 +00:00
Dan Gohman
a2730abaaa
Complete the sentance in this comment. I have reservations
...
about the code it describes, but at least now the comment
is right.
llvm-svn: 64465
2009-02-13 17:36:42 +00:00
Duncan Sands
566ed10244
If a function only reads memory, then we know that...
...
it only reads memory! The other change has no
functional effect, it just seems more logical to
go in order of decreasing knowledge.
llvm-svn: 64463
2009-02-13 17:32:26 +00:00
Nick Lewycky
d234a845f9
Mark strto* as readonly when the endptr is null.
...
llvm-svn: 64460
2009-02-13 17:08:33 +00:00
Nick Lewycky
a0e83a0952
On strtod and friends, mark 'endptr' nocapture in the function prototype, and
...
mark the first argument nocapture if endptr=NULL for each particular call.
llvm-svn: 64453
2009-02-13 15:31:46 +00:00
Duncan Sands
51495609df
Reapply r64301. These uses of "inline" can cause strange
...
link-time failures when building with optimization. Just
get rid of them.
llvm-svn: 64449
2009-02-13 09:42:34 +00:00
Evan Cheng
cf4bd2319c
Switch from new[] + delete[] to malloc + free since llvm does not catch C++ exceptions.
...
llvm-svn: 64448
2009-02-13 08:24:55 +00:00
Evan Cheng
333db7abbd
If new[] fails, return 0 rather then trying to dereference a null pointer.
...
llvm-svn: 64444
2009-02-13 07:54:34 +00:00
Nick Lewycky
cdccffe731
Reapply r64300:
...
Make sure the SCC pass manager initializes any contained
function pass managers. Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.
llvm-svn: 64443
2009-02-13 07:15:53 +00:00
Nick Lewycky
c60bd012bc
BasicAA was making the assumption that a local allocation which hadn't escaped
...
couldn't ever be the return of call instruction. However, it's quite possible
that said local allocation is itself the return of a function call. That's
what malloc and calloc are for, actually.
llvm-svn: 64442
2009-02-13 07:06:27 +00:00
Dan Gohman
f71a473720
Fix the code that checked if a SCEVAddRecExpr Start contains an
...
addrec in a different loop to check the value being added to
the accumulated Start value, not the Start value before it has
the new value added to it. This prevents LSR from going crazy
on the included testcase. Dale, please review.
llvm-svn: 64440
2009-02-13 03:58:31 +00:00
Dale Johannesen
3a8bd17fdb
Remove non-DebugLoc versions of BuildMI from IA64, Mips.
...
llvm-svn: 64438
2009-02-13 02:34:39 +00:00
Dale Johannesen
9bba902c83
Remove non-DebugLoc versions of BuildMI from X86.
...
There were some that might even matter in X86FastISel.
llvm-svn: 64437
2009-02-13 02:33:27 +00:00
Dale Johannesen
57097d2a26
missed file
...
llvm-svn: 64436
2009-02-13 02:32:04 +00:00
Dale Johannesen
215a925766
Remove non-DebugLoc versions of buildMI from Sparc.
...
llvm-svn: 64435
2009-02-13 02:31:35 +00:00
Dale Johannesen
635f2a69d9
Remove non-DebugLoc versions of BuildMI from Alpha and Cell.
...
llvm-svn: 64433
2009-02-13 02:30:42 +00:00
Dale Johannesen
460bfeba8c
Remove refs to non-DebugLoc version of BuildMI from XCore, PIC16.
...
llvm-svn: 64432
2009-02-13 02:29:03 +00:00
Dale Johannesen
e9f623e27c
Remove refs to non-DebugLoc version of BuildMI from PowerPC.
...
llvm-svn: 64431
2009-02-13 02:27:39 +00:00
Dale Johannesen
b851a7853a
and one more file
...
llvm-svn: 64430
2009-02-13 02:26:21 +00:00
Dale Johannesen
7647da67ea
Remove refs to non-DebugLoc versions of BuildMI from ARM.
...
llvm-svn: 64429
2009-02-13 02:25:56 +00:00
Bill Wendling
65c0fd4c44
Revert this. It was breaking stuff.
...
llvm-svn: 64428
2009-02-13 02:16:35 +00:00
Bill Wendling
1c21ac3066
Turn off the old way of handling debug information in the code generator. Use
...
the new way, where all of the information is passed on SDNodes and machine
instructions.
llvm-svn: 64427
2009-02-13 02:01:04 +00:00
Dan Gohman
ba83228cdb
Fix LSR's IV sorting function to explicitly sort by bitwidth
...
after sorting by stride value. This prevents it from missing
IV reuse opportunities in a host-sensitive manner.
llvm-svn: 64415
2009-02-13 00:26:43 +00:00
Dale Johannesen
baca6ed65e
Check in missing file.
...
llvm-svn: 64410
2009-02-12 23:24:44 +00:00
Dale Johannesen
6b8c76a910
Eliminate a couple of non-DebugLoc BuildMI variants.
...
Modify callers.
llvm-svn: 64409
2009-02-12 23:08:38 +00:00
Dan Gohman
eb6be650ce
Teach IndVarSimplify to optimize code using the C "int" type for
...
loop induction on LP64 targets. When the induction variable is
used in addressing, IndVars now is usually able to inserst a
64-bit induction variable and eliminates the sign-extending cast.
This is also useful for code using C "short" types for
induction variables on targets with 32-bit addressing.
Inserting a wider induction variable is easy; the tricky part is
determining when trunc(sext(i)) expressions are no-ops. This
requires range analysis of the loop trip count. A common case is
when the original loop iteration starts at 0 and exits when the
induction variable is signed-less-than a fixed value; this case
is now handled.
This replaces IndVarSimplify's OptimizeCanonicalIVType. It was
doing the same optimization, but it was limited to loops with
constant trip counts, because it was running after the loop
rewrite, and the information about the original induction
variable is lost by that point.
Rename ScalarEvolution's executesAtLeastOnce to
isLoopGuardedByCond, generalize it to be able to test for
ICMP_NE conditions, and move it to be a public function so that
IndVars can use it.
llvm-svn: 64407
2009-02-12 22:19:27 +00:00
Nate Begeman
94aa38d568
Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
...
type of the vectors being shuffled.
llvm-svn: 64401
2009-02-12 21:28:33 +00:00
Dale Johannesen
655775293f
Arrange to print constants that match "n" and "i" constraints
...
in inline asm as signed (what gcc does). Add partial support
for x86-specific "e" and "Z" constraints, with appropriate
signedness for printing.
llvm-svn: 64400
2009-02-12 20:58:09 +00:00
Dan Gohman
656b097b8a
Add a utility function to LoopInfo to return the exit block
...
when the loop has exactly one exit, and make use of it in
LoopIndexSplit.
llvm-svn: 64388
2009-02-12 18:08:24 +00:00
Chris Lattner
844deb73f4
fix PR3538 for ARM.
...
llvm-svn: 64384
2009-02-12 17:38:23 +00:00
Chris Lattner
4d4c702d5f
fix PR3538 for PPC
...
llvm-svn: 64383
2009-02-12 17:37:15 +00:00
Chris Lattner
aed3a4215b
fix the X86 backend to just drop llvm.declare nodes for VLAs instead of
...
leaving them in the DAG and then getting selection errors. This is a
fix for PR3538.
llvm-svn: 64382
2009-02-12 17:33:11 +00:00
Dan Gohman
e366c29fa0
Adjust the sizes for a few SmallVectors to reflect their usage.
...
llvm-svn: 64381
2009-02-12 17:29:01 +00:00
Chris Lattner
90880e2598
make fast isel fall back to selectiondags for VLA llvm.declare intrinsics.
...
llvm-svn: 64379
2009-02-12 17:23:20 +00:00
Dan Gohman
e0d32c490a
This code doesn't actually use the ExitingBlocks list.
...
llvm-svn: 64376
2009-02-12 16:36:26 +00:00
Evan Cheng
cf5cd6ecfe
It's (currently) not safe to keep certain physical registers live across basic blocks, e.g. x86 fp stack registers.
...
llvm-svn: 64374
2009-02-12 10:32:17 +00:00
Evan Cheng
b570499c25
Oops. Last second clean up messed things up.
...
llvm-svn: 64373
2009-02-12 09:52:13 +00:00
Evan Cheng
8b39b545a9
If availability info is kept when fallthrough into a bb, add the available registers to live-in set.
...
llvm-svn: 64372
2009-02-12 09:43:23 +00:00
Evan Cheng
3a14efacb6
Replace one of burr scheduling heuristic with something more sensible. Now calcMaxScratches simply compute the number of true data dependencies. This actually improve a couple of tests in dejagnu suite as many tests in llvm nightly test suite.
...
llvm-svn: 64369
2009-02-12 08:59:45 +00:00
Julien Lerouge
7682ffdeb9
Fix MingW build, patch by Kenneth Boyd!
...
llvm-svn: 64366
2009-02-12 07:39:10 +00:00
Chris Lattner
feb129e813
Fix a nasty bug (PR3550) where the inline pass could incorrectly mark
...
calls with the tail marker when inlining them through an invoke. Patch,
testcase, and perfect analysis by Jay Foad!
llvm-svn: 64364
2009-02-12 07:06:42 +00:00
Chris Lattner
096f44de61
improve naming of values in GVN, patch by Jay Foad!
...
llvm-svn: 64363
2009-02-12 07:00:35 +00:00
Chris Lattner
5297c63565
fix PR3537: if resetting bbi back to the start of a block, we need to
...
forget about already inserted expressions.
llvm-svn: 64362
2009-02-12 06:56:08 +00:00
Nick Lewycky
b92c4d72a7
Don't mark all args to strtod and friends as nocapture.
...
llvm-svn: 64352
2009-02-12 03:18:34 +00:00
Bill Wendling
f6d609a227
Move debug loc info along when the spiller creates new instructions.
...
llvm-svn: 64342
2009-02-12 00:02:55 +00:00
Evan Cheng
6f6abfd94b
Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
...
llvm-svn: 64340
2009-02-11 23:42:39 +00:00
Evan Cheng
eb5ec4a0db
Remove a bogus assertion. It's possible a live-in available value is used by a previous instruction.
...
llvm-svn: 64339
2009-02-11 23:41:57 +00:00
Nate Begeman
318aea93bf
the two non-mask arguments to a shufflevector must be the same width, but they do not have to be the same
...
width as the result value.
llvm-svn: 64335
2009-02-11 22:36:25 +00:00
Bill Wendling
27b508db9b
Propagate DebugLoc info for spiller call-backs.
...
llvm-svn: 64329
2009-02-11 21:51:19 +00:00
Dan Gohman
45889d24fe
Fix a comment.
...
llvm-svn: 64328
2009-02-11 21:32:08 +00:00
Dan Gohman
6571ef3577
Don't use special heuristics for nodes with no data predecessors
...
unless they actually have data successors, and likewise for nodes
with no data successors unless they actually have data precessors.
llvm-svn: 64327
2009-02-11 21:29:39 +00:00
Dan Gohman
298a2946f1
Delete the heuristic for non-livein CopyFromReg nodes. Non-liveinness
...
is determined by whether the node has a Flag operand. However, if the
node does have a Flag operand, it will be glued to its register's
def, so the heuristic would end up spuriously applying to whatever
node is the def.
llvm-svn: 64319
2009-02-11 20:25:59 +00:00
Dan Gohman
27f85854f9
Don't try to set an EFLAGS operand to dead if no instruction was created.
...
This fixes a bug introduced by r61215.
llvm-svn: 64316
2009-02-11 19:50:24 +00:00
Dale Johannesen
cc5fc44d02
Make a transformation added in 63266 a bit less aggressive.
...
It was transforming (x&y)==y to (x&y)!=0 in the case where
y is variable and known to have at most one bit set (e.g. z&1).
This is not correct; the expressions are not equivalent when y==0.
I believe this patch salvages what can be salvaged, including
all the cases in bt.ll. Dan, please review.
Fixes gcc.c-torture/execute/20040709-[12].c
llvm-svn: 64314
2009-02-11 19:19:41 +00:00
Bill Wendling
5f14a01340
Revert r64300 and r64301. These were causing the following errors respectively:
...
During llvm-gcc bootstrap:
Undefined symbols:
"llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from:
(anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&)
in libLLVMipa.a(CallGraphSCCPass.o)
"llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from:
(anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&)
in libLLVMipa.a(CallGraphSCCPass.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1
During an LLVM release build:
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction names with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction information with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td assembly writer with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Compiling InstructionCombining.cpp for Release build
if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \
then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans
llvm-svn: 64311
2009-02-11 18:19:24 +00:00
Duncan Sands
5b3349064d
These uses of "inline" can cause strange link-time
...
failures when building with optimization. Just get
rid of them.
llvm-svn: 64301
2009-02-11 12:25:15 +00:00
Duncan Sands
003754f656
Make sure the SCC pass manager initializes any contained
...
function pass managers. Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.
llvm-svn: 64300
2009-02-11 09:58:43 +00:00
Evan Cheng
a1968b0fc7
Implement PR3495: local spiller optimization. The local spiller can now keep availability information over BB boundaries. It visits BB's in depth first order. After visiting a BB if it find a successor which has a single predecessor it visits the successor next without clearing the availability information. This allows the successor to omit reloads or change them into copies.
...
llvm-svn: 64298
2009-02-11 08:24:21 +00:00
Dan Gohman
dfaf646c34
When scheduling a block in parts, keep track of the overall
...
instruction index across each part. Instruction indices are used
to make live range queries, and live ranges can extend beyond
scheduling region boundaries.
Refactor the ScheduleDAGSDNodes class some more so that it
doesn't have to worry about this additional information.
llvm-svn: 64288
2009-02-11 04:27:20 +00:00
Devang Patel
316705027b
If llvm.dbg.region.end is disappearing then remove corresponding llvm.dbg.func.start also.
...
llvm-svn: 64278
2009-02-11 01:29:06 +00:00
Dan Gohman
1262a25683
Don't print extra spaces in vector and array constants. This makes
...
them visually more consistent with vector and array types.
llvm-svn: 64267
2009-02-11 00:25:25 +00:00
Dan Gohman
27fa408b64
Use iterators to iterate through the Preds array instead of
...
an index. This code is on the hot-path because the current
way SDep edges are uniqued has quadratic complexity.
llvm-svn: 64262
2009-02-11 00:12:28 +00:00
Dan Gohman
b3dbb21df1
Consider any instruction that modifies the stack pointer to be
...
a scheduling region boundary. This isn't necessary for
correctness; it helps with compile time, as it avoids the need
for data- and anti-dependencies from all spills and reloads on
the stack-pointer modification.
llvm-svn: 64255
2009-02-10 23:29:38 +00:00
Dan Gohman
b95434356c
Factor out more code for computing register live-range informationfor
...
scheduling, and generalize is so that preserves state across
scheduling regions. This fixes incorrect live-range information around
terminators and labels, which are effective region boundaries.
In place of looking for terminators to anchor inter-block dependencies,
introduce special entry and exit scheduling units for this purpose.
llvm-svn: 64254
2009-02-10 23:27:53 +00:00
Devang Patel
654e47f366
Ignore dbg intrinsic while folding unconditional branch.
...
llvm-svn: 64242
2009-02-10 22:14:17 +00:00
Evan Cheng
589a539423
Handle llvm.x86.sse2.maskmov.dqu in 64-bit.
...
llvm-svn: 64240
2009-02-10 22:06:28 +00:00
Evan Cheng
df15f13c34
80 col violations.
...
llvm-svn: 64237
2009-02-10 21:39:44 +00:00
Devang Patel
da1a632a87
Use early exits. Reduce indentation.
...
llvm-svn: 64226
2009-02-10 19:28:07 +00:00
Dan Gohman
1f517dd1c4
Use const, to support platforms where strrchr returns a const char *.
...
This fixes PR3535.
llvm-svn: 64224
2009-02-10 17:56:28 +00:00
Duncan Sands
d1de45a146
Pacify gcc-4.3 (thinks IsConstant may be used
...
uninitialized).
llvm-svn: 64220
2009-02-10 16:24:55 +00:00
Evan Cheng
ce3bbe515b
Fix PR3457: Ignore control successors when looking for closest scheduled successor. A control successor doesn't read result(s) produced by the scheduling unit being evaluated.
...
llvm-svn: 64210
2009-02-10 08:30:11 +00:00
Devang Patel
4bed3565f3
Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
...
llvm-svn: 64209
2009-02-10 07:48:18 +00:00
Devang Patel
caf4485781
Enable scalar replacement of AllocaInst whose one of the user is dbg info.
...
llvm-svn: 64207
2009-02-10 07:00:59 +00:00
Devang Patel
9b6c1d6313
Validate file id.
...
llvm-svn: 64204
2009-02-10 06:04:08 +00:00
Sanjiv Gupta
c3f7b82628
Function temporaries can not overlap with retval or args.See the comment in source code to know the reason. Anything having .auto. in its name is local to a function in nature irrespective of the linkage specified. print static local variables in module level IDATA section.
...
llvm-svn: 64199
2009-02-10 04:20:26 +00:00
Evan Cheng
e5ade4a9a1
Implement FpSET_ST1_*.
...
llvm-svn: 64186
2009-02-09 23:32:07 +00:00
Evan Cheng
3af42a8a14
If the target cannot issue a copy for the given source and dest registers, abort instead of silently continue.
...
llvm-svn: 64184
2009-02-09 22:47:36 +00:00
Dale Johannesen
cd19967754
Fix PR 3471, and some cleanups.
...
llvm-svn: 64177
2009-02-09 22:14:15 +00:00
Evan Cheng
fe174df170
Simplify code.
...
llvm-svn: 64164
2009-02-09 21:01:06 +00:00
Evan Cheng
020588cee3
Make sure constant subscript is truncated to ptr size if it may not fit.
...
llvm-svn: 64163
2009-02-09 20:54:38 +00:00
Dan Gohman
a950e99dee
Use doxygen comment syntax.
...
llvm-svn: 64150
2009-02-09 18:12:09 +00:00
Dan Gohman
9280a685db
Use slightly more correct grammar in error messages.
...
llvm-svn: 64148
2009-02-09 17:41:21 +00:00
Gabor Greif
cab008f51f
make sure that BranchInst::getSuccessor() does not assert in cast<>
...
even if the underlying operand is NULL. This may happen in debugging context
within opt with partial loop unrolling (see test/Transforms/LoopUnroll/partial.ll).
After this fix I can resubmit the (backed out) r63459:
* lib/VMCore/AsmWriter.cpp: use precise accessors.
llvm-svn: 64142
2009-02-09 15:45:06 +00:00
Evan Cheng
f736bd9c79
Re-enable machine sinking pass now that the coalescer bugs and the AnalyzeBrnach bug are fixed.
...
llvm-svn: 64126
2009-02-09 08:45:39 +00:00
Evan Cheng
81ae066ab6
Fix another case ShortenDeadCopySrcLiveRange is shortening too much. No test case possible since I don't know what to grep for. :-(
...
llvm-svn: 64125
2009-02-09 08:37:45 +00:00
Evan Cheng
64dfcacd5f
Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nasty
...
suprise to some callers, e.g. register coalescer. For now, add an parameter
that tells AnalyzeBranch whether it's safe to modify the mbb. A better
solution is out there, but I don't have time to deal with it right now.
llvm-svn: 64124
2009-02-09 07:14:22 +00:00
Mikhail Glushenkov
8b5bfbfc7a
Add a Sleep() function.
...
llvm-svn: 64101
2009-02-08 22:47:39 +00:00
Mikhail Glushenkov
a6435d48bc
Add Emacs hints to Alarm.inc.
...
Also removes some trailing whitespace and fixes one 80-column violation.
llvm-svn: 64094
2009-02-08 21:10:57 +00:00
Chris Lattner
1aca40e349
add a note.
...
llvm-svn: 64093
2009-02-08 20:44:19 +00:00
Chris Lattner
c9e1b48449
fix typo
...
llvm-svn: 64091
2009-02-08 20:00:15 +00:00
Chris Lattner
412f626b96
reject void pointers with a nice error:
...
llvm-as: t.ll:2:15: pointers to void are invalid, use i8* instead
%X = type void*
^
instead of asserting and dying.
llvm-svn: 64089
2009-02-08 19:56:22 +00:00
Evan Cheng
b3783639cb
Fix PR3486. Fix a bug in code that manually patch physical register live interval after its sub-register is coalesced with a virtual register.
...
llvm-svn: 64082
2009-02-08 11:04:35 +00:00
Evan Cheng
942519306e
Strengthen the previous check.
...
llvm-svn: 64076
2009-02-08 08:24:28 +00:00
Evan Cheng
fe014df914
r64073 commit message is lost. Here it is:
...
Right now if the coalesced copy def is dead and its src is a kill, and that
there are now other uses within the live range, the coalescer would mark the
def of the source register as dead. But it should also check if there are
other kills which means the value has other uses not in the live range.
llvm-svn: 64075
2009-02-08 08:00:36 +00:00
Evan Cheng
e5e95f7717
(no commit message)
...
llvm-svn: 64073
2009-02-08 07:48:37 +00:00
Bill Wendling
415515077b
Mistakenly turned this on.
...
llvm-svn: 64065
2009-02-08 01:32:00 +00:00
Bill Wendling
5469ec1072
Revert r63999. It was breaking self-hosting builds.
...
llvm-svn: 64062
2009-02-08 00:58:05 +00:00
Chris Lattner
d8f0786c31
Add missing break statements, fixing PR3503.
...
llvm-svn: 64040
2009-02-07 22:37:06 +00:00
Mon P Wang
21eb52a74f
Instrcombine should not change load(cast p) to cast(load p) if the cast
...
changes the address space of the pointer.
llvm-svn: 64035
2009-02-07 22:19:29 +00:00
Dale Johannesen
9c310711bb
Use getDebugLoc forwarder instead of getNode()->getDebugLoc.
...
No functional change.
llvm-svn: 64026
2009-02-07 19:59:05 +00:00
Dan Gohman
747e55bc9a
Constify TargetInstrInfo::EmitInstrWithCustomInserter, allowing
...
ScheduleDAG's TLI member to use const.
llvm-svn: 64018
2009-02-07 16:15:20 +00:00
Nick Lewycky
ef01e112aa
Add an API for strings with possible NULLs in the middle. Refactor the other
...
two AddString methods to use it.
llvm-svn: 64005
2009-02-07 04:57:08 +00:00
Mike Stump
f009a51794
Insert space to avoid warning and make code more readable.
...
llvm-svn: 64003
2009-02-07 03:36:02 +00:00
Dale Johannesen
8ba7132128
Make SDNode constructors take a DebugLoc always.
...
Adjust derived classes to pass UnknownLoc where
a DebugLoc does not make sense. Pick one of
DebugLoc and non-DebugLoc variants to survive
for all such classes.
llvm-svn: 64000
2009-02-07 02:15:05 +00:00
Evan Cheng
9571621665
Enable machine sinking pass in non-fast mode.
...
llvm-svn: 63999
2009-02-07 01:57:46 +00:00
Dale Johannesen
a72d41a67b
Remove now-unused constructors.
...
llvm-svn: 63995
2009-02-07 01:27:09 +00:00
Evan Cheng
47a65a167d
Don't sink the instruction if TargetRegisterInfo::isSafeToMoveRegClassDefs doesn't think it's safe. This works around PR1911.
...
llvm-svn: 63994
2009-02-07 01:21:47 +00:00
Dale Johannesen
4ea526268c
Needs this file too.
...
llvm-svn: 63993
2009-02-07 00:56:46 +00:00
Dale Johannesen
62fd95d6ec
Get rid of the last non-DebugLoc versions of getNode!
...
Many targets build placeholder nodes for special operands, e.g.
GlobalBaseReg on X86 and PPC for the PIC base. There's no
sensible way to associate debug info with these. I've left
them built with getNode calls with explicit DebugLoc::getUnknownLoc operands.
I'm not too happy about this but don't see a good improvement;
I considered adding a getPseudoOperand or something, but it
seems to me that'll just make it harder to read.
llvm-svn: 63992
2009-02-07 00:55:49 +00:00
Dan Gohman
4e3e3deed3
Refactor some repeated logic into a separate function.
...
llvm-svn: 63989
2009-02-07 00:43:41 +00:00
Dan Gohman
78fe44ed52
Make a comment a doxygen comment.
...
llvm-svn: 63988
2009-02-07 00:42:54 +00:00
Dale Johannesen
84935759d5
Remove more non-DebugLoc getNode variants. Use
...
getCALLSEQ_{END,START} to permit passing no DebugLoc
there. UNDEF doesn't logically have DebugLoc; add
getUNDEF to encapsulate this.
llvm-svn: 63978
2009-02-06 23:05:02 +00:00
Dale Johannesen
dc93bbc4b0
And one more file.
...
llvm-svn: 63971
2009-02-06 21:55:48 +00:00
Dale Johannesen
400dc2e2e4
Remove more non-DebugLoc versions of getNode.
...
llvm-svn: 63969
2009-02-06 21:50:26 +00:00
Bill Wendling
b6b0aa2449
Record debug location information in the Dwarf writer.
...
A simple test program shows that debugging works. :-)
llvm-svn: 63968
2009-02-06 21:45:08 +00:00
Bill Wendling
03c34d0d3c
Clear out the CurDebugLoc info when doing a 'clear' on the SDL object.
...
llvm-svn: 63967
2009-02-06 21:36:23 +00:00
Dan Gohman
21cb4114fb
Split the locking out of JIT::runJITOnFunction so that callers
...
that already hold the lock can call an entry point that doesn't
re-acquire the lock.
llvm-svn: 63965
2009-02-06 21:25:08 +00:00
Dan Gohman
af8f994681
Use .size and .type on ELF systems; this helps tools that map
...
addresses to symbols.
llvm-svn: 63962
2009-02-06 21:15:52 +00:00
Dale Johannesen
ab8e4425a3
Eliminate remaining non-DebugLoc version of getTargetNode.
...
llvm-svn: 63951
2009-02-06 19:16:40 +00:00
Dan Gohman
817a24f8e9
Rename SelectionDAGISel::Schedule to
...
SelectionDAGISel::CreateScheduler, and make it just create the
scheduler. Leave running the scheduler to the higher-level code.
This makes the higher-level code a little more explicit and
easier to follow, and will help enable some future refactoring.
llvm-svn: 63944
2009-02-06 18:26:51 +00:00
Sanjiv Gupta
48d6bb9924
Print globl directive for variables with external linkage (global variables).
...
llvm-svn: 63943
2009-02-06 18:24:59 +00:00
Dan Gohman
cd2cd9f5d7
Delete an unused member function.
...
llvm-svn: 63941
2009-02-06 18:19:52 +00:00
Evan Cheng
066757eea1
Move getPointerRegClass from TargetInstrInfo to TargetRegisterInfo.
...
llvm-svn: 63938
2009-02-06 17:43:24 +00:00
Dan Gohman
483377c639
Move ScheduleDAGSDNodes.h to be a private header. Front-ends
...
that previously included this header should include
SchedulerRegistry.h instead.
llvm-svn: 63937
2009-02-06 17:22:58 +00:00
Evan Cheng
b5f0ec3eb7
Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook.
...
llvm-svn: 63936
2009-02-06 17:17:30 +00:00
Dan Gohman
f4b08b4f6c
Move ScheduleDAGInstrs.h to be a private header. Front-ends
...
that used this header to select a scheduling policy should
use SchedulerRegistry.h instead (llvm-gcc and clang were
updated a while ago).
llvm-svn: 63934
2009-02-06 17:12:10 +00:00
Devang Patel
7cb8df4ce7
Ignore DbgInfoIntrinsics.
...
llvm-svn: 63923
2009-02-06 06:19:06 +00:00
Chris Lattner
bbbb74372b
fix PR3489, use bits instead of bytes.
...
llvm-svn: 63916
2009-02-06 04:34:07 +00:00
Dale Johannesen
2c4cf2752d
get rid of some non-DebugLoc getTargetNode variants.
...
llvm-svn: 63909
2009-02-06 02:08:06 +00:00
Dale Johannesen
9f3f72f144
Get rid of one more non-DebugLoc getNode and
...
its corresponding getTargetNode. Lots of
caller changes.
llvm-svn: 63904
2009-02-06 01:31:28 +00:00
Owen Anderson
5a043f2cb1
Fix a crasher: we need to check that the function is non-null before using it!
...
llvm-svn: 63902
2009-02-06 00:13:43 +00:00
Owen Anderson
98a3617fba
Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it
...
folds away some never-used methods.
llvm-svn: 63900
2009-02-05 23:36:27 +00:00
Devang Patel
409b794cfe
Ignore dbg intrinsics while propagating conditional expression info. Take 2.
...
llvm-svn: 63898
2009-02-05 23:32:52 +00:00
Evan Cheng
2599084ac5
isAsCheapAsMove instructions can have register src operands. Check if they are really re-materializable.
...
This fixes sse.expandfft and sse.stepfft.
llvm-svn: 63890
2009-02-05 22:24:17 +00:00
Dale Johannesen
f80493bbfd
Remove a non-DebugLoc version of getNode.
...
llvm-svn: 63889
2009-02-05 22:07:54 +00:00
Devang Patel
02f58e1e8d
Revert rev. 63876. It is causing llvm-gcc bootstrap failure.
...
llvm-svn: 63888
2009-02-05 21:46:41 +00:00
Dale Johannesen
3eb373f5ce
Remove 3 non-DebugLoc variants of getNode.
...
llvm-svn: 63886
2009-02-05 21:20:44 +00:00
Devang Patel
58cb603d2a
Remove dead blocks in the end.
...
llvm-svn: 63880
2009-02-05 19:59:42 +00:00
Devang Patel
5922e26d1a
Ignore dbg intrinsics while propagating conditional expression info.
...
llvm-svn: 63876
2009-02-05 19:15:39 +00:00
Evan Cheng
9d8bfbfdef
Machine LICM increases register pressure and it almost always increase code size. For now, disable it for optimizing for size.
...
llvm-svn: 63856
2009-02-05 08:51:13 +00:00
Evan Cheng
409c25f78d
Turn on machine LICM in non-fast mode.
...
llvm-svn: 63855
2009-02-05 08:46:33 +00:00
Evan Cheng
399660c384
Teach machine licm to CSE hoisted instructions.
...
llvm-svn: 63854
2009-02-05 08:45:46 +00:00
Evan Cheng
0f734469eb
ReMaterializeTrivialDef need to trim the live interval to the last kill if the copy kills the source register. This fixes uint64tof64.ll after ARM::MOVi is marked as isAsCheapAsAMove.
...
llvm-svn: 63853
2009-02-05 08:45:04 +00:00
Evan Cheng
64fdacc27f
A few more isAsCheapAsAMove.
...
llvm-svn: 63852
2009-02-05 08:42:55 +00:00
Chris Lattner
7e1d2862ca
if we have a large GEP offset on a 32-bit or other target, make
...
sure to print the value properly sext'd to the right pointer size.
This fixes PR3481.
llvm-svn: 63843
2009-02-05 06:55:21 +00:00
Owen Anderson
7411523ee6
Pre-alloc splitting needs to be more careful to avoid inserting spills/restores
...
between call frame setup/restore points. Unfortunately, this regresses
code size a bit, but at least it's correct now!
llvm-svn: 63837
2009-02-05 05:58:41 +00:00
Mon P Wang
3f0e0a6dea
Fix a bug where we were not emitting a cvt rnd sat node for converting
...
between a unsigned integer and signed integer.
llvm-svn: 63831
2009-02-05 04:47:42 +00:00
Dale Johannesen
b842d529a3
Reapply 63765. Patches for clang and llvm-gcc to follow.
...
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen
12c572b6fa
Get rid of 3 non-DebugLoc getNode variants.
...
llvm-svn: 63808
2009-02-05 01:01:16 +00:00
Devang Patel
086b212277
Ignore dbg intrinsics while folding switch instruction.
...
llvm-svn: 63802
2009-02-05 00:30:42 +00:00
Dale Johannesen
7ae8c8b108
Remove non-DebugLoc versions of getMergeValues, ZeroExtendInReg.
...
llvm-svn: 63800
2009-02-05 00:20:09 +00:00
Dale Johannesen
f08a47bb70
Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
...
Adjust callers.
llvm-svn: 63789
2009-02-04 23:02:30 +00:00
Dale Johannesen
ae616c2c61
Reverting 63765. This broke the build of both clang
...
and llvm-gcc.
llvm-svn: 63786
2009-02-04 22:47:25 +00:00
Devang Patel
916fdce16d
Ignore dbg intrinsics.
...
llvm-svn: 63781
2009-02-04 21:39:48 +00:00
Stuart Hastings
556bd92698
80 column rule.
...
llvm-svn: 63768
2009-02-04 20:30:10 +00:00
Dale Johannesen
021052a705
Remove non-DebugLoc versions of getLoad and getStore.
...
Adjust the many callers of those versions.
llvm-svn: 63767
2009-02-04 20:06:27 +00:00
Nate Begeman
6ae3aa83d0
New feature: add support for target intrinsics being defined in the
...
target directories themselves. This also means that VMCore no longer
needs to know about every target's list of intrinsics. Future work
will include converting the PowerPC target to this interface as an
example implementation.
llvm-svn: 63765
2009-02-04 19:47:21 +00:00
Mon P Wang
34650735d0
Avoids generating a legalization assert for the case where a vector type is legal
...
but when legalizing the operation, we split the vector type and generate a library
call whose type needs to be promoted. For example, X86 with SSE on but MMX off,
a divide v2i64 will be scalarized to 2 calls to a library using i64.
llvm-svn: 63760
2009-02-04 19:38:14 +00:00
Chris Lattner
e84a7911c4
Bill implemented this.
...
llvm-svn: 63752
2009-02-04 19:09:07 +00:00
Chris Lattner
553fd7e1eb
add a note, this is why we're faster at SciMark-MonteCarlo with
...
SSE disabled.
llvm-svn: 63751
2009-02-04 19:08:01 +00:00
Evan Cheng
9ec370f748
Skip over zero registers.
...
llvm-svn: 63748
2009-02-04 18:18:58 +00:00
Chris Lattner
370ec10dad
allow main to have any integer type.
...
llvm-svn: 63743
2009-02-04 17:48:18 +00:00
Dan Gohman
556d14d483
Minor code cleanups; no functionality change.
...
llvm-svn: 63740
2009-02-04 17:28:58 +00:00
Stuart Hastings
ffee3d831a
Since I'm obliged to work with a development OS that currently doesn't
...
support GraphViz, I've been using the foo->dump() facility. This
patch is a minor rewrite to the SelectionDAG dump() stuff to make it a
little more helpful. The existing foo->dump() functionality does not
change; this patch adds foo->dumpr(). All of this is only useful when
running LLVM under a debugger.
llvm-svn: 63736
2009-02-04 16:46:19 +00:00
Duncan Sands
e7d5479136
Allow the inverse transform x86_fp80 -> i80 (also
...
fires during the Ada build).
llvm-svn: 63731
2009-02-04 11:17:06 +00:00
Duncan Sands
1ea1173143
Fix PR3468: a crash when constant folding a bitcast of
...
i80 to x86 long double (this was presumably generated
by sroa).
llvm-svn: 63730
2009-02-04 10:17:14 +00:00
Evan Cheng
4ded601445
Don't call isInvariantLoad twice.
...
llvm-svn: 63729
2009-02-04 09:21:58 +00:00
Evan Cheng
1d9f7ac8cc
Don't bother hoisting out a "cheap" instruction if all of its uses are PHIs. LICM "cheap" instructions are not particularly beneficial to start with. This will just end up making the copies harder to coalesce.
...
llvm-svn: 63728
2009-02-04 09:19:56 +00:00
Evan Cheng
0649abdfe2
For now, only hoist re-materilizable instructions. LICM will increase register pressure. We want to avoid spilling more instructions if it's possible.
...
llvm-svn: 63725
2009-02-04 07:17:49 +00:00
Nick Lewycky
a89ec99fa2
Reapply patch from r62553, with a fix to avoid looking for an ffi.h that isn't
...
there.
This changes the interpreter to use libffi. After this patch, the interpreter
will barely be able to call any external functions if built on a system without
libffi installed (just enough to pass 'make check' really). But with libffi,
we can now call any function that isn't variadic or taking a struct or vector
parameter (but pointer to struct is fine). Patch by Alexei Svitkine!
llvm-svn: 63723
2009-02-04 06:26:47 +00:00
Owen Anderson
1caf7fef8e
Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
...
BasicAA to make use of this fact when computing ModRef info.
llvm-svn: 63718
2009-02-04 05:16:46 +00:00
Dale Johannesen
679073b420
Remove non-DebugLoc forms of the exotic forms
...
of Lod and Sto; patch uses.
llvm-svn: 63716
2009-02-04 02:34:38 +00:00
Dale Johannesen
f2bb6f09a3
Remove some more non-DebugLoc versions of construction
...
functions, with callers adjusted to fit.
llvm-svn: 63705
2009-02-04 01:48:28 +00:00
Dale Johannesen
efb82cfbf2
Check in file I forgot.
...
llvm-svn: 63704
2009-02-04 01:33:20 +00:00
Dale Johannesen
85263882aa
Remove a few non-DebugLoc versions of node creation
...
functions.
llvm-svn: 63703
2009-02-04 01:17:06 +00:00
Mon P Wang
4379a795fe
Fixes a case where we generate an incorrect mask for pshfhw in the presence
...
of undefs and incorrectly determining if we have punpckldq.
llvm-svn: 63702
2009-02-04 01:16:59 +00:00
Devang Patel
fd9f635103
While folding vallue comparison terminators ignore dbg intrinsics.
...
llvm-svn: 63700
2009-02-04 01:06:11 +00:00
Dale Johannesen
bbf13f54e0
Patch up omissions in DebugLoc propagation.
...
llvm-svn: 63693
2009-02-04 00:33:20 +00:00
Dale Johannesen
9888edee10
Fill in more omissions in DebugLog propagation.
...
I think that's it for this directory.
llvm-svn: 63690
2009-02-04 00:13:36 +00:00
Bill Wendling
0b4403f9bd
Constify and don't return a reference.
...
llvm-svn: 63689
2009-02-04 00:05:34 +00:00
Devang Patel
f10e287c65
Ignore dbg intrinsics while hoisting common code in the two blocks up into the branch block.
...
llvm-svn: 63687
2009-02-04 00:03:08 +00:00
Dale Johannesen
3a09f5589d
DebugLoc propagation; adjustment to things omitted
...
from SelectionDagBuild.
llvm-svn: 63680
2009-02-03 23:04:43 +00:00
Bill Wendling
77b3be8ea3
Erm. Would be nice to initialize this variable. . .
...
llvm-svn: 63677
2009-02-03 22:55:54 +00:00
Bill Wendling
2c0a4fe4e2
Add getDebugLocTuple to retrieve the DebugLocTuple for a given DebugLoc object.
...
llvm-svn: 63676
2009-02-03 22:49:58 +00:00
Dale Johannesen
0404dc11af
Need this file too.
...
llvm-svn: 63674
2009-02-03 22:26:34 +00:00
Dale Johannesen
abf66b8343
Add some DL propagation to places that didn't
...
have it yet. More coming.
llvm-svn: 63673
2009-02-03 22:26:09 +00:00
Devang Patel
2032cadd0f
Do not let dbg intrinsic block folding of two entry phi node.
...
llvm-svn: 63671
2009-02-03 22:12:02 +00:00
Devang Patel
43a1161379
If "optimize for size" attribute is set then block non-trivial loop unswitches but allow trivial loop unswitches.
...
llvm-svn: 63670
2009-02-03 22:04:27 +00:00
Dale Johannesen
14f2d9dcbd
DebugLoc propgation
...
llvm-svn: 63664
2009-02-03 21:48:12 +00:00
Bill Wendling
dd7fa33679
More whitespace fixin'.
...
llvm-svn: 63663
2009-02-03 21:38:21 +00:00
Bill Wendling
eaf02df7b4
Whitespace and comment changes. No functionality change.
...
llvm-svn: 63660
2009-02-03 21:17:20 +00:00
Chris Lattner
ef37dc8511
teach "convert from scalar" to handle loads of fca's.
...
llvm-svn: 63659
2009-02-03 21:08:45 +00:00
Chris Lattner
f5df53cb46
refactor the interface to ConvertUsesOfLoadToScalar,
...
renaming it to ConvertScalar_ExtractValue
llvm-svn: 63658
2009-02-03 21:01:03 +00:00
Dale Johannesen
1eb1ef2cfd
DebugLoc propagation. done with file.
...
llvm-svn: 63656
2009-02-03 20:21:25 +00:00
Devang Patel
9c7c0db37a
Remove dead code.
...
llvm-svn: 63653
2009-02-03 19:46:28 +00:00
Chris Lattner
576baa4adf
convert ConvertUsesOfLoadToScalar to use IRBuilder,
...
no functionality change.
llvm-svn: 63652
2009-02-03 19:45:44 +00:00
Chris Lattner
c1fb96d347
switch ConvertScalar_InsertValue to use an IRBuilder, no
...
functionality change.
llvm-svn: 63651
2009-02-03 19:41:50 +00:00
Dale Johannesen
66e03e6f7b
DebugLoc propagation. 2/3 through file.
...
llvm-svn: 63650
2009-02-03 19:33:06 +00:00
Chris Lattner
18f56c295c
make scalar conversion handle stores of first class
...
aggregate values. loads are not yet handled (coming
soon to an sroa near you).
llvm-svn: 63649
2009-02-03 19:30:11 +00:00
Dan Gohman
d564353193
Change the post-RA scheduler to iterate through the
...
basic-block segments bottom-up instead of top down. This
is the first step in a general restructuring of the way
register liveness is tracked in the post-RA scheduler.
llvm-svn: 63643
2009-02-03 18:57:45 +00:00
Dan Gohman
561d1226b6
Tevert part of the x86 subtarget logic changes: when -march=x86-64
...
is given, override the subtarget settings and enable 64-bit support.
This restores the earlier behavior, and fixes regressions on
Non-64-bit-capable x86-32 hosts.
This isn't necessarily the best approach, but the most obvious
alternative is to require -mcpu=x86-64 or -mattr=+64bit to be used
with -march=x86-64 when the host doesn't have 64-bit support. This
makes things little more consistent, but it's less convenient, and
it has the practical drawback of requiring lots of test changes, so
I opted for the above approach for now.
llvm-svn: 63642
2009-02-03 18:53:21 +00:00
Devang Patel
70da8e8425
First initialize DAG otherwise dwarf writer is used uninitialized.
...
Duncan spotted this. Thanks!
llvm-svn: 63641
2009-02-03 18:46:32 +00:00
Chris Lattner
73eff2e6e8
Make SROA produce a vector only when the alloca is actually
...
accessed at least once as a vector. This prevents it from
compiling the example in not-a-vector into:
define double @test(double %A, double %B) {
%tmp4 = insertelement <7 x double> undef, double %A, i32 0
%tmp = insertelement <7 x double> %tmp4, double %B, i32 4
%tmp2 = extractelement <7 x double> %tmp, i32 4
ret double %tmp2
}
instead, producing the integer code. Producing vectors when they
aren't otherwise in the program is dangerous because a lot of other
code treats them carefully and doesn't want to break them down.
OTOH, many things want to break down tasty i448's.
llvm-svn: 63638
2009-02-03 18:15:05 +00:00
Duncan Sands
a77c5f758c
Fix PR3411. When replacing values, nodes are analyzed
...
in any old order. Since analyzing a node analyzes its
operands also, this can mean that when we pop a node
off the list of nodes to be analyzed, it may already
have been analyzed.
llvm-svn: 63632
2009-02-03 10:23:33 +00:00
Evan Cheng
8542caa3f7
APInt'fy SimplifyDemandedVectorElts so it can analyze vectors with more than 64 elements.
...
llvm-svn: 63631
2009-02-03 10:05:09 +00:00
Chris Lattner
80810b4c2d
add another case of undefined behavior without crashing, PR3466.
...
llvm-svn: 63620
2009-02-03 07:08:57 +00:00
Nick Lewycky
05daea5d32
Revert r63600. It didn't fix the bug, it just moved it a bit.
...
llvm-svn: 63618
2009-02-03 06:30:37 +00:00
Owen Anderson
f755c2b7a4
Teach AliasAnalysis that a bunch of the atomic intrinsics only dereference their arguments.
...
llvm-svn: 63616
2009-02-03 06:27:22 +00:00
Nick Lewycky
12a130bd06
Update the callgraph when replacing InvokeInst with CallInst when inlining.
...
llvm-svn: 63600
2009-02-03 04:34:40 +00:00
Bill Wendling
67cd395d45
Explicitly pass in debug location information to BuildMI.
...
llvm-svn: 63599
2009-02-03 02:29:34 +00:00
Bill Wendling
135227a060
Pass in something sensible for the debug location information when creating the
...
initial PHI nodes of the machine function.
llvm-svn: 63598
2009-02-03 02:20:52 +00:00
Chris Lattner
fa4e35aca7
fix a bitcode reader bug where it can't handle extractelement correctly:
...
the index of the value being extracted is always an i32. This fixes PR3465
llvm-svn: 63597
2009-02-03 02:11:28 +00:00
Chris Lattner
6aa6b1f263
Teach ConvertUsesToScalar to handle memset, allowing it to handle
...
crazy cases like:
struct f { int A, B, C, D, E, F; };
short test4() {
struct f A;
A.A = 1;
memset(&A.B, 2, 12);
return A.C;
}
llvm-svn: 63596
2009-02-03 02:01:43 +00:00
Dale Johannesen
db39362c90
Fill in some missing DL propagation in getNode()s.
...
llvm-svn: 63595
2009-02-03 01:55:44 +00:00
Bill Wendling
143a2c3470
Use SDL->getCurDebugLoc() instead of unknown loc for landing pads.
...
llvm-svn: 63594
2009-02-03 01:55:42 +00:00
Bill Wendling
fa50a23f8a
Explicitly pass in the "unknown" debug location. This is probably not
...
correct. We need more infrastructure before we can get the DebugLoc info for
these instructions.
llvm-svn: 63593
2009-02-03 01:33:28 +00:00
Bill Wendling
9862a64419
Alphabetize includes.
...
llvm-svn: 63591
2009-02-03 01:32:22 +00:00
Chris Lattner
09b65ab288
rearrange how SRoA handles promotion of allocas to vectors.
...
With the new world order, it can handle cases where the first
store into the alloca is an element of the vector, instead of
requiring the first analyzed store to have the vector type
itself. This allows us to un-xfail
test/CodeGen/X86/vec_ins_extract.ll.
llvm-svn: 63590
2009-02-03 01:30:09 +00:00
Dan Gohman
fb306c0a10
Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp since
...
they are useful to analyses other than BasicAliasAnalysis.cpp. Include
the full comment for isIdentifiedObject in the header file. Thanks to
Chris for suggeseting this.
llvm-svn: 63589
2009-02-03 01:28:32 +00:00
Bill Wendling
17450acc3b
Propagate debug loc info during SDNode -> machine instr creation.
...
llvm-svn: 63585
2009-02-03 01:02:39 +00:00
Bill Wendling
e3c78361d3
Create DebugLoc information in FastISel. Several temporary methods were
...
created. Specifically, those BuildMIs which use
"DebugLoc::getUnknownLoc()". I'll remove them soon.
llvm-svn: 63584
2009-02-03 00:55:04 +00:00
Dale Johannesen
f1163e9a4d
Propagation in TargetLowering. Includes passing a DL
...
into SimplifySetCC which gets called elsewhere.
llvm-svn: 63583
2009-02-03 00:47:48 +00:00
Dan Gohman
76a07f59d4
Use the SubclassData field to hold ExtType, isTrunc, and MemIndexedMode
...
information. This eliminates the need for the Flags field in MemSDNode,
so this makes LoadSDNode and StoreSDNode smaller. Also, it makes
FoldingSetNodeIDs for loads and stores two AddIntegers smaller.
llvm-svn: 63577
2009-02-03 00:08:45 +00:00
Dan Gohman
7403751e16
Change Feature64Bit to not imply FeatureSSE2. All x86-64 hardware has
...
SSE2, however it's possible to disable SSE2, and the subtarget support
code thinks that if 64-bit implies SSE2 and SSE2 is disabled then
64-bit should also be disabled. Instead, just mark all the 64-bit
subtargets as explicitly supporting SSE2.
Also, move the code that makes -march=x86-64 enable 64-bit support by
default to only apply when there is no explicit subtarget. If you
need to specify a subtarget and you want 64-bit code, you'll need to
select a subtarget that supports 64-bit code.
llvm-svn: 63575
2009-02-03 00:04:43 +00:00
Dale Johannesen
72ba6df1a9
Last DebugLoc propagation for this file.
...
llvm-svn: 63574
2009-02-02 23:46:53 +00:00
Dale Johannesen
b5dd922a92
More DebugLoc propagation. This should be everything
...
except LegalizeOp itself.
llvm-svn: 63560
2009-02-02 22:49:46 +00:00
Mike Stump
b92f839f9c
Improve -fno-opt style option processing to not require an extra
...
option to make the -fno- form on the option. We also document the new
form in the CommandLine documentation.
llvm-svn: 63559
2009-02-02 22:48:49 +00:00
Owen Anderson
4eda2cbe5f
MergeValueInto is too smart: it might choose to do the merge the opposite direction.
...
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.
llvm-svn: 63558
2009-02-02 22:42:01 +00:00
Dale Johannesen
a02e45ca19
DebugLoc propagation. ExpandOp and PromoteOp,
...
among others.
llvm-svn: 63555
2009-02-02 22:12:50 +00:00
Torok Edwin
e83866065b
Only force SSE level if it is not correct.
...
Add an assert to check HasX86_64 status.
llvm-svn: 63552
2009-02-02 21:57:34 +00:00
Dale Johannesen
ae7992a333
Commit missing files.
...
llvm-svn: 63545
2009-02-02 20:47:48 +00:00
Chris Lattner
43cecd7c26
inline SROA::ConvertToScalar, no functionality change.
...
llvm-svn: 63544
2009-02-02 20:44:45 +00:00
Dale Johannesen
ad00f6e010
More DebugLoc propagation.
...
llvm-svn: 63543
2009-02-02 20:41:04 +00:00
Torok Edwin
5dbd26ae0f
remove #if 0 code on Bill's request.
...
llvm-svn: 63542
2009-02-02 20:23:02 +00:00
Duncan Sands
dab7be8774
Remove trailing spaces.
...
llvm-svn: 63540
2009-02-02 19:46:41 +00:00
Dale Johannesen
8525d83aac
DebugLoc propagation for int<->fp conversions.
...
llvm-svn: 63537
2009-02-02 19:03:57 +00:00
Evan Cheng
03f862579c
Refactor PerformPHIConstruction, no functionality changes.
...
llvm-svn: 63536
2009-02-02 18:33:18 +00:00
Chris Lattner
18eba4f211
Fix a bug which caused us to miscompile a couple of Ada
...
tests. Thanks for the beautiful reduced testcase Duncan!
llvm-svn: 63529
2009-02-02 18:02:59 +00:00
Devang Patel
97ba824ad9
Do not add redundant arguments in a method definition DIE.
...
llvm-svn: 63527
2009-02-02 17:51:41 +00:00
Sanjiv Gupta
8e56d1898b
Duncan's patch. Further to 64382. Takes care of illegal types for shift amount.
...
llvm-svn: 63523
2009-02-02 17:19:39 +00:00
Sanjiv Gupta
50aeb12d80
Made the common case of default address space directive as non-virtual for performance reasons. Provide a single virtual interface for directives of all sizes in non-default address spaces.
...
llvm-svn: 63521
2009-02-02 16:53:06 +00:00
Duncan Sands
6f361ff345
Fix a comment (bytes -> bits), reformat a comment
...
and remove trailing whitespace. No functionality
change.
llvm-svn: 63511
2009-02-02 10:06:20 +00:00
Duncan Sands
33d6e97e33
Fix an obvious thinko.
...
llvm-svn: 63510
2009-02-02 09:53:14 +00:00
Evan Cheng
dc636c4080
ADD / SUB / SMUL / UMUL with overflow second result top bits must be zero.
...
llvm-svn: 63509
2009-02-02 09:15:04 +00:00
Evan Cheng
4988c597b3
Add comment.
...
llvm-svn: 63506
2009-02-02 08:19:07 +00:00
Evan Cheng
50e15bdf81
Teach LowerBRCOND to recognize (xor (setcc x), 1). The xor inverts the condition. It's normally transformed by the dag combiner, unless the condition is set by a arithmetic op with overflow.
...
llvm-svn: 63505
2009-02-02 08:07:36 +00:00
Chris Lattner
b2b177393c
reject things like: zext <4 x i32> %tmp to i256
...
llvm-svn: 63504
2009-02-02 07:40:17 +00:00
Chris Lattner
1f386b8ec8
Fix PR3372
...
llvm-svn: 63501
2009-02-02 07:24:28 +00:00
Chris Lattner
1aafe4cece
reduce indentation, (~XorCST->getValue()).isSignBit() -> isMaxSignedValue()
...
llvm-svn: 63500
2009-02-02 07:15:30 +00:00
Mon P Wang
cc866c955c
Preserve more SourceValue information.
...
llvm-svn: 63498
2009-02-02 06:37:55 +00:00
Torok Edwin
a2d1f35e9a
Implement -mno-sse: if SSE is disabled on x86-64, don't store XMM on stack for
...
var-args, and don't allow FP return values
llvm-svn: 63495
2009-02-01 18:15:56 +00:00
Duncan Sands
3ed768868d
Fix PR3453 and probably a bunch of other potential
...
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.
llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling
a6c75ffd73
Forgot some more DebugLoc propagations.
...
llvm-svn: 63493
2009-02-01 11:19:36 +00:00
Owen Anderson
19616c08a0
Fix test failures causes by my previous commit.
...
llvm-svn: 63492
2009-02-01 08:41:54 +00:00
Owen Anderson
66838e9a27
Fix an issue in PHI construction that was exposed by GCC 4.2 producing a different set iteration order for the reg_iterator.
...
llvm-svn: 63490
2009-02-01 07:06:00 +00:00
Evan Cheng
676130f2e1
Fix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.
...
llvm-svn: 63489
2009-02-01 06:42:27 +00:00
Dale Johannesen
dfbb6a1a9a
DebugLoc propagation.
...
llvm-svn: 63488
2009-01-31 22:04:51 +00:00
Nick Lewycky
f23908151a
Reinstate this optimization to fold icmp of xor when possible. Don't try to
...
turn icmp eq a+x, b+x into icmp eq a, b if a+x or b+x has other uses. This
may have been increasing register pressure leading to the bzip2 slowdown.
llvm-svn: 63487
2009-01-31 21:30:05 +00:00
Dale Johannesen
5f98ea28ca
DebugLoc propagation. Done with file.
...
llvm-svn: 63486
2009-01-31 21:04:24 +00:00
Dale Johannesen
4d9fa9e71d
DebugLoc propagation. Done with file.
...
llvm-svn: 63485
2009-01-31 20:01:02 +00:00
Chris Lattner
9e2b9f3234
Fix PR3452 (an infinite loop bootstrapping) by disabling the recent
...
improvements to the EvaluateInDifferentType code. This code works
by just inserted a bunch of new code and then seeing if it is
useful. Instcombine is not allowed to do this: it can only insert
new code if it is useful, and only when it is converging to a more
canonical fixed point. Now that we iterate when DCE makes progress,
this causes an infinite loop when the code ends up not being used.
llvm-svn: 63483
2009-01-31 19:05:27 +00:00
Duncan Sands
41826036b1
Fix PR3401: when using large integers, the type
...
returned by getShiftAmountTy may be too small
to hold shift values (it is an i8 on x86-32).
Before and during type legalization, use a large
but legal type for shift amounts: getPointerTy;
afterwards use getShiftAmountTy, fixing up any
shift amounts with a big type during operation
legalization. Thanks to Dan for writing the
original patch (which I shamelessly pillaged).
llvm-svn: 63482
2009-01-31 15:50:11 +00:00
Chris Lattner
76a63ed099
now that all the pieces are in place, teach instcombine's
...
simplifydemandedbits to simplify instructions with *multiple
uses* in contexts where it can get away with it. This allows
it to simplify the code in multi-use-or.ll into a single 'add
double'.
This change is particularly interesting because it will cover
up for some common codegen bugs with large integers created due
to the recent SROA patch. When working on fixing those bugs,
this should be disabled.
llvm-svn: 63481
2009-01-31 08:40:03 +00:00
Chris Lattner
3e2cb66c56
simplify/clarify control flow and improve comments, no functionality change.
...
llvm-svn: 63480
2009-01-31 08:24:16 +00:00
Chris Lattner
83c6a141b8
make some fairly meaty internal changes to how SimplifyDemandedBits works.
...
Now, if it detects that "V" is the same as some other value,
SimplifyDemandedBits returns the new value instead of RAUW'ing it immediately.
This has two benefits:
1) simpler code in the recursive SimplifyDemandedBits routine.
2) it allows future fun stuff in instcombine where an operation has multiple
uses and can be simplified in one context, but not all.
#2 isn't implemented yet, this patch should have no functionality change.
llvm-svn: 63479
2009-01-31 08:15:18 +00:00
Chris Lattner
585cfb2ce7
minor cleanups
...
llvm-svn: 63477
2009-01-31 07:26:06 +00:00
Chris Lattner
94cfb281c3
make sure to set Changed=true when instcombine hacks on the code,
...
not doing so prevents it from properly iterating and prevents it
from deleting the entire body of dce-iterate.ll
llvm-svn: 63476
2009-01-31 07:04:22 +00:00
Mon P Wang
cf9ba82324
If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
...
when A==B, -0.0 != +0.0.
llvm-svn: 63474
2009-01-31 06:07:45 +00:00
Bill Wendling
3b585af0ec
Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
...
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Chris Lattner
ec99c46d44
Simplify and generalize the SROA "convert to scalar" transformation to
...
be able to handle *ANY* alloca that is poked by loads and stores of
bitcasts and GEPs with constant offsets. Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc. This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.
One case that is pretty great is that we compile
2006-11-07-InvalidArrayPromote.ll into:
define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
%tmp105 = bitcast <4 x i32> %tmp10 to i128
%tmp1056 = zext i128 %tmp105 to i256
%tmp.upgrd.43 = lshr i256 %tmp1056, 96
%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32
ret i32 %tmp.upgrd.44
}
which turns into:
_func:
subl $28, %esp
cvttps2dq %xmm1, %xmm0
movaps %xmm0, (%esp)
movl 12(%esp), %eax
addl $28, %esp
ret
Which is pretty good code all things considering :).
One effect of this is that SROA will start generating arbitrary bitwidth
integers that are a multiple of 8 bits. In the case above, we got a
256 bit integer, but the codegen guys assure me that it can handle the
simple and/or/shift/zext stuff that we're doing on these operations.
This addresses rdar://6532315
llvm-svn: 63469
2009-01-31 02:28:54 +00:00
Dale Johannesen
db7c5f6a7b
Move CurDebugLoc into SelectionDAGLowering.
...
llvm-svn: 63468
2009-01-31 02:22:37 +00:00
Gabor Greif
dc588689bb
back out my previous change, it exposes a latent bug. investigating
...
llvm-svn: 63463
2009-01-31 01:31:59 +00:00
Gabor Greif
f88092ee06
use precise accessors
...
llvm-svn: 63459
2009-01-31 00:58:14 +00:00
Dale Johannesen
dc0f124429
Propagate debug info in LegalizeFloatTypes.
...
Complete (modulo bugs).
llvm-svn: 63458
2009-01-31 00:43:08 +00:00
Dale Johannesen
42aa385e20
Propagate debug info. This file complete
...
(modulo bugs)
llvm-svn: 63457
2009-01-31 00:20:43 +00:00
Dale Johannesen
c910889511
Propagate debug info through MakeLibCall and a
...
couple of things that use it.
llvm-svn: 63456
2009-01-31 00:11:23 +00:00
Bill Wendling
31b50991cb
More DebugLoc propagation.
...
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Bill Wendling
27d9dd4b57
More DebugLoc propagation.
...
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling
306bfc2213
More DebugLoc propagation in LOAD etc. methods.
...
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Bill Wendling
0bd29743e3
More DebugLoc propagation in floating-point methods.
...
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Dale Johannesen
555a375bb6
Make LowerCallTo and LowerArguments take a DebugLoc
...
argument. Adjust all callers and overloaded versions.
llvm-svn: 63444
2009-01-30 23:10:59 +00:00
Bill Wendling
6fbf5495f8
Standardize comments about folding xforms.
...
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling
8fb81f1b3d
Get rid of the non-DebugLoc-ified getNOT() method.
...
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling
3dc5d2454e
Propagate debug loc info for some FP arithmetic methods.
...
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling
cb9be5d174
Propagate debug loc info for some FP arithmetic methods.
...
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling
4e0a61514b
Propagate debug loc info for BIT_CONVERT.
...
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Bill Wendling
7bfa43b022
Propagate debug loc info for more *_EXTEND methods.
...
llvm-svn: 63437
2009-01-30 22:33:24 +00:00
Bill Wendling
9b3dc8d848
Propagate debug loc info for ANY_EXTEND.
...
llvm-svn: 63436
2009-01-30 22:27:33 +00:00
Bill Wendling
c409318562
Propagate debug loc info for some of the *_EXTEND functions.
...
llvm-svn: 63434
2009-01-30 22:23:15 +00:00
Bill Wendling
cab9a2eef5
DebugLoc form of getNOT().
...
llvm-svn: 63433
2009-01-30 22:11:22 +00:00
Bill Wendling
b6b6f46fe4
- Propagate debug loc info for SELECT.
...
- Added xform for (select X, 1, Y) and (select X, Y, 0), which was commented on,
but missing.
llvm-svn: 63428
2009-01-30 22:02:18 +00:00
Bill Wendling
d51e3ff540
Propagate debug loc info for Shifts.
...
llvm-svn: 63424
2009-01-30 21:37:17 +00:00
Bill Wendling
35972a9460
Propagate debug loc info for XOR and MatchRotate.
...
llvm-svn: 63420
2009-01-30 21:14:50 +00:00
Bill Wendling
f29b6e1318
Propagate debug loc info for OR. Also clean up some comments.
...
llvm-svn: 63419
2009-01-30 20:59:34 +00:00
Bill Wendling
ff8acd684f
Perform obvious constant arithmetic folding.
...
llvm-svn: 63417
2009-01-30 20:50:00 +00:00
Bill Wendling
8617191302
Propagate debug loc info for AND. Also clean up some comments.
...
llvm-svn: 63416
2009-01-30 20:43:18 +00:00
Bill Wendling
781db7a1ad
Propagate debug loc info in SimplifyBinOpWithSameOpcodeHands.
...
llvm-svn: 63411
2009-01-30 19:25:47 +00:00
Gabor Greif
1933b00c12
use precise getters
...
llvm-svn: 63403
2009-01-30 18:27:21 +00:00
Gabor Greif
97f1720621
use precise getters
...
llvm-svn: 63402
2009-01-30 18:21:13 +00:00
Devang Patel
c094970cd2
Each input file is encoded as a separate compile unit in LLVM debugging
...
information output. However, many target specific tool chains prefer to encode
only one compile unit in an object file. In this situation, the LLVM code
generator will include debugging information entities in the compile unit
that is marked as main compile unit. The code generator accepts maximum one main
compile unit per module. If a module does not contain any main compile unit
then the code generator will emit multiple compile units in the output object
file.
[Part 1]
Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit to mark the unit as "main" unit. By defaults all units are considered non-main. Update SourceLevelDebugging.html to document "main" compile unit.
Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here.
Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit.
[Part 2]
Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs.
---
This is Part 1.
llvm-svn: 63400
2009-01-30 18:20:31 +00:00
Zhou Sheng
4b23938fb9
As Duncan suggested, add braces for the one-line "else branch".
...
Thanks, Duncan.
llvm-svn: 63389
2009-01-30 09:44:49 +00:00
Zhou Sheng
25b6f8153e
This is to fix the bug in IntrinsicLowering.cpp,
...
the LowerPartSet(). It didn't handle the situation correctly when
the low, high argument values are in reverse order (low > high)
with 'Val' type i32 (a corner case).
llvm-svn: 63388
2009-01-30 09:02:50 +00:00
Sanjiv Gupta
c10d810303
Fixed the comment. No functionality change.
...
llvm-svn: 63387
2009-01-30 09:01:44 +00:00
Mike Stump
ecbe4a0860
Add opposite_of and inverse_opt to support -fno- style options. This
...
is necessary for eventual gcc commmand line compatibility.
llvm-svn: 63384
2009-01-30 08:19:46 +00:00
Sanjiv Gupta
082174cb78
Use sublw for comparison with literals instead of subwf.
...
llvm-svn: 63382
2009-01-30 07:55:25 +00:00
Mon P Wang
cbb20a6ee1
When PerformBuildVectorCombine, avoid creating a X86ISD::VZEXT_LOAD of
...
an illegal type.
llvm-svn: 63380
2009-01-30 07:07:40 +00:00
Sanjiv Gupta
964a29f671
Enable emitting of constant values in non-default address space as well. The APIs emitting constants now take an additional parameter signifying the address space in which to emit. The APIs like getData8BitsDirective() etc are made virtual enabling targets to be able to define appropirate directivers for various sizes and address spaces.
...
llvm-svn: 63377
2009-01-30 04:25:10 +00:00
Bill Wendling
9b3407e5bb
Propagate debug loc info in SimplifyNodeWithTwoResults.
...
llvm-svn: 63376
2009-01-30 03:08:40 +00:00
Bill Wendling
faed065e5c
Propagate debug loc info for MULHS.
...
llvm-svn: 63375
2009-01-30 03:00:18 +00:00
Bill Wendling
d033af09fd
Propagate debug loc info for SREM and UREM.
...
llvm-svn: 63374
2009-01-30 02:57:00 +00:00
Bill Wendling
aff3e03765
Propagate debug loc info for UDIV.
...
llvm-svn: 63373
2009-01-30 02:55:25 +00:00
Bill Wendling
5b663e7b53
Propagate debug loc info for SDIV.
...
llvm-svn: 63372
2009-01-30 02:52:17 +00:00
Bill Wendling
b48dcf67e5
Forgot to propagate debug loc info here.
...
llvm-svn: 63371
2009-01-30 02:49:26 +00:00
Dan Gohman
1ee0d41ef8
Fix a post-RA scheduling dependency bug.
...
If a MachineInstr doesn't have a memoperand but has an opcode that
is known to load or store, assume its memory reference may alias
*anything*, including stack slots which the compiler completely
controls.
To partially compensate for this, teach the ScheduleDAG building
code to do basic getUnderlyingValue analysis. This greatly
reduces the number of instructions that require restrictive
dependencies. This code will need to be revisited when we start
doing real alias analysis, but it should suffice for now.
llvm-svn: 63370
2009-01-30 02:49:14 +00:00
Bill Wendling
091f92f568
Propagate debug loc info for MUL.
...
llvm-svn: 63369
2009-01-30 02:45:56 +00:00
Bill Wendling
48ff08ef3e
Propagate debug loc info in SUB.
...
llvm-svn: 63368
2009-01-30 02:42:10 +00:00
Bill Wendling
6127757920
Propagate debug loc info in ADDC and ADDE.
...
llvm-svn: 63367
2009-01-30 02:38:00 +00:00
Bill Wendling
c442348dd7
Propagate debug loc info in DAG combine's "ADD".
...
llvm-svn: 63366
2009-01-30 02:31:17 +00:00
Bill Wendling
cdd96133bd
- Propagate debug loc info in combineSelectAndUse().
...
- Modify ReassociateOps so that the resulting SDValue is what the comment claims
it is.
llvm-svn: 63365
2009-01-30 02:23:43 +00:00
Dale Johannesen
ed255b3d8e
Propagate debug info when building SelectionDAG.
...
llvm-svn: 63359
2009-01-30 01:34:22 +00:00
Devang Patel
33a21670f4
Remove dead code, again.
...
llvm-svn: 63358
2009-01-30 01:27:49 +00:00
Devang Patel
776a4c5baa
Remove dead code.
...
llvm-svn: 63357
2009-01-30 01:25:47 +00:00
Devang Patel
4ba91058d2
Add DW_AT_declaration for class methods.
...
llvm-svn: 63356
2009-01-30 01:21:46 +00:00
Bill Wendling
9c9a3b6665
Propagate debug location info for the token factor.
...
llvm-svn: 63355
2009-01-30 01:13:16 +00:00
Devang Patel
199740651c
Add dump() routines to help debug debug info :)
...
llvm-svn: 63353
2009-01-30 01:03:10 +00:00
Bill Wendling
f6d0aff0bd
Add DebugLoc propagation to some of the methods in DAG combiner.
...
llvm-svn: 63350
2009-01-30 00:45:56 +00:00
Owen Anderson
bf77d2eb9d
Correct the algorithms for choosing spill and restore points so that we don't try to insert loads/stores between call frame setup and the actual call.
...
This fixes the last known failure for the pre-alloc-splitter.
llvm-svn: 63339
2009-01-29 22:13:06 +00:00
Dan Gohman
14d55f0a5c
Explicitly add PseudoSourceValue information when lowering
...
BUILD_VECTOR and conversions to stack operations.
llvm-svn: 63333
2009-01-29 21:02:43 +00:00
Dan Gohman
60d6844aa8
Make a few things const, fix some comments, and simplify
...
some assertions.
llvm-svn: 63328
2009-01-29 19:49:27 +00:00
Chris Lattner
dfb6735385
Fix windows build, patch by Marius Wachtler!
...
llvm-svn: 63325
2009-01-29 18:53:28 +00:00
Evan Cheng
a160d4af82
Local register allocator shouldn't assume only the entry and landing pad basic blocks have live-ins.
...
llvm-svn: 63323
2009-01-29 18:37:30 +00:00
Dan Gohman
8b437ccbbe
Fix two typos that Duncan spotted in a comment.
...
llvm-svn: 63312
2009-01-29 16:18:12 +00:00
Dan Gohman
ef04ed5477
In the case of an extractelement on an insertelement value,
...
the element indices may be equal if either one is not a
constant.
llvm-svn: 63311
2009-01-29 16:10:46 +00:00
Bill Wendling
a434d930ff
Revert r63273. This was already implemented by Dale. There's no need for my
...
change.
llvm-svn: 63301
2009-01-29 09:01:55 +00:00
Owen Anderson
c0924a0632
Fix an issue where restores could be inserted after a terminator instruction,
...
and an iterator invalidation issue.
FreeBench/pifft no longer miscompiles with these fixes!
llvm-svn: 63293
2009-01-29 08:22:06 +00:00
Owen Anderson
a590802ed6
Comments are good. :-)
...
llvm-svn: 63276
2009-01-29 05:41:02 +00:00
Owen Anderson
b05ce78c51
Add support for aggressive load-use-store folding. This takes care of the
...
vast majority of code size regressions introduced by pre-alloc-splitting.
llvm-svn: 63274
2009-01-29 05:28:55 +00:00
Bill Wendling
50338007b9
- Add DebugLoc to getTargetNode().
...
- Modify TableGen to add the DebugLoc when calling getTargetNode.
(The light-weight wrappers are only temporary. The non-DebugLoc version will be
removed once the whole debug info stuff is finished with.)
llvm-svn: 63273
2009-01-29 05:27:31 +00:00
Chris Lattner
c0474013cb
Fix PR3424, a static constructor ordering issue. Patch by Robert Schuster!
...
llvm-svn: 63269
2009-01-29 04:43:42 +00:00
Evan Cheng
76a2736c74
Exit with nice warnings when register allocator run out of registers.
...
llvm-svn: 63267
2009-01-29 02:20:59 +00:00
Dan Gohman
e58ab79f33
Make x86's BT instruction matching more thorough, and add some
...
dagcombines that help it match in several more cases. Add
several more cases to test/CodeGen/X86/bt.ll. This doesn't
yet include matching for BT with an immediate operand, it
just covers more register+register cases.
llvm-svn: 63266
2009-01-29 01:59:02 +00:00
Evan Cheng
89ba594975
A slight compile time optimization. If the caller knows there isn't a free register getReg() should not call getFreeReg().
...
llvm-svn: 63263
2009-01-29 01:13:00 +00:00
Dale Johannesen
839acbb089
Add DebugLoc-sensitive versions of many node creation
...
functions. Currently omitted: memcpy, memmove, memset.
llvm-svn: 63259
2009-01-29 00:47:48 +00:00
Evan Cheng
55ca1d38ea
Fix comment about removeRange.
...
llvm-svn: 63255
2009-01-29 00:06:09 +00:00
Mon P Wang
9150f735fa
Fixed lowering of v816 shuffles.
...
llvm-svn: 63252
2009-01-28 23:11:14 +00:00
Bill Wendling
1b6a3bce82
Add DebugLoc to the getNode() methods.
...
llvm-svn: 63245
2009-01-28 22:17:52 +00:00
Dale Johannesen
666bf20441
Add DebugLoc-aware constructors for SDNode derived
...
classes (those that reasonably have a DebugLoc
associated with them).
llvm-svn: 63236
2009-01-28 21:18:29 +00:00
Devang Patel
d7ecb3b661
Do not forget to derived type while constructing an array type.
...
llvm-svn: 63233
2009-01-28 21:08:20 +00:00
Chris Lattner
df17987c19
Fix some issues with volatility, move "CanConvertToScalar" check
...
after the others.
llvm-svn: 63227
2009-01-28 20:16:43 +00:00
Mon P Wang
a15ea78ea6
Fixed extract element when the result needs to be promoted and the input widened.
...
llvm-svn: 63217
2009-01-28 18:53:39 +00:00
Dan Gohman
4aa1846215
Make isOperationLegal do what its name suggests, and introduce a
...
new isOperationLegalOrCustom, which does what isOperationLegal
previously did.
Update a bunch of callers to use isOperationLegalOrCustom
instead of isOperationLegal. In some case it wasn't obvious
which behavior is desired; when in doubt I changed then to
isOperationLegalOrCustom as that preserves their previous
behavior.
This is for the second half of PR3376.
llvm-svn: 63212
2009-01-28 17:46:25 +00:00
Duncan Sands
ba21b7d57a
Formatting.
...
llvm-svn: 63199
2009-01-28 14:42:54 +00:00
Duncan Sands
5a913d61e3
Rename getAnalysisToUpdate to getAnalysisIfAvailable.
...
llvm-svn: 63198
2009-01-28 13:14:17 +00:00
Duncan Sands
08e53d041f
Fix PR3415 (infinite loop in EscapeAnalysis) by
...
deleting the escape analysis pass.
llvm-svn: 63197
2009-01-28 11:33:59 +00:00
Evan Cheng
f31f288863
The memory alignment requirement on some of the mov{h|l}p{d|s} patterns are 16-byte. That is overly strict. These instructions read / write f64 memory locations without alignment requirement.
...
llvm-svn: 63195
2009-01-28 08:35:02 +00:00
Mon P Wang
5a685a52c1
Add shuffle splat pattern for x86 sse shifts.
...
llvm-svn: 63193
2009-01-28 08:12:05 +00:00
Mikhail Glushenkov
57cf3964f3
Clarify comment.
...
llvm-svn: 63171
2009-01-28 03:46:22 +00:00
Dan Gohman
b3bbde3e62
Use ValueType::bitsLT to simplify some code.
...
llvm-svn: 63170
2009-01-28 03:10:52 +00:00
Dan Gohman
172ad92b29
Use ZERO_EXTEND instead of ANY_EXTEND when promoting
...
shift amounts, to avoid implicitly assuming that
target architectures will ignore the high bits.
llvm-svn: 63169
2009-01-28 02:58:31 +00:00
Evan Cheng
e4510972a6
Suppress a compile time warning.
...
llvm-svn: 63161
2009-01-28 00:53:34 +00:00
Devang Patel
5adc3dbc96
Add type DIE into appropriate context DIE.
...
llvm-svn: 63154
2009-01-27 23:22:55 +00:00
Dale Johannesen
4e04ef3c55
Add a DebugLoc field and some simple accessors.
...
llvm-svn: 63152
2009-01-27 23:20:29 +00:00
Anton Korobeynikov
70d4c08cfe
Treat [1 x i8] zeroinitializer as a C string, placing such stuff into
...
mergeable string section. I don't see any bad impact of such decision
(rather then placing it into mergeable const section, as it was before),
but at least Darwin linker won't complain anymore.
The problem in LLVM is that we don't have special type for string constants
(like gcc does). Even more, we have two separate types: ConstatArray for non-null
strings and ConstantAggregateZero for null stuff.... It's a bit weird :)
llvm-svn: 63142
2009-01-27 22:29:24 +00:00
Evan Cheng
573e529127
Refine DebugLoc per review comments.
...
llvm-svn: 63132
2009-01-27 21:15:07 +00:00
Dan Gohman
fb58faf29e
Add an assertion to the form of SelectionDAG::getConstant that takes
...
a uint64_t to verify that the value is in range for the given type,
to help catch accidental overflow. Fix a few places that relied on
getConstant implicitly truncating the value.
llvm-svn: 63128
2009-01-27 20:39:34 +00:00
Dan Gohman
0ca1e7c6b6
Reformat the allocation-order arrays to a more conventional style.
...
llvm-svn: 63121
2009-01-27 19:25:38 +00:00
Dan Gohman
0bd9546039
Delete redundant return statements.
...
llvm-svn: 63120
2009-01-27 19:23:22 +00:00
Dan Gohman
13f18e853f
Respect the DisableRedZone flag on PowerPC.
...
llvm-svn: 63119
2009-01-27 19:19:28 +00:00
Dan Gohman
f77f0ce21a
Simplify findNonImmUse; return the result using the return value
...
instead of via a by-reference argument. No functionality change.
llvm-svn: 63118
2009-01-27 19:04:30 +00:00
Torok Edwin
ec39eb8519
APInt's countLeadingOnes() was broken for negative i128 values,
...
causing assertion failures in getSExtValue().
Fix it by making highWordBits actually contain what its name says,
and add some more unit-tests for APInt.
This fixes PR3419.
llvm-svn: 63107
2009-01-27 18:06:03 +00:00
Owen Anderson
431053ed2c
Make the pre-split-limit option more useful by using a per-function counter.
...
llvm-svn: 63091
2009-01-27 05:01:15 +00:00
Evan Cheng
1bc8af207e
Implement multiple with overflow by 2 with an add instruction.
...
llvm-svn: 63090
2009-01-27 03:30:42 +00:00
Dan Gohman
7740523a89
Eliminate unnecessary operands-list traversals.
...
llvm-svn: 63088
2009-01-27 02:37:43 +00:00
Dan Gohman
75cee3a93c
Enable the red zone on x86-64 by default.
...
llvm-svn: 63078
2009-01-27 00:58:47 +00:00
Devang Patel
45c899cd15
Assorted debug info fixes.
...
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.
llvm-svn: 63077
2009-01-27 00:45:04 +00:00
Dan Gohman
1cd2a2c9f8
Fix the Red Zone calculation for functions with frame pointers.
...
Don't use the Red Zone when dynamic stack realignment is needed.
This could be implemented, but most x86-64 ABIs don't require
dynamic stack realignment so it isn't urgent.
llvm-svn: 63074
2009-01-27 00:40:06 +00:00
Evan Cheng
b8c79bdc31
No need to keep size of DebugLocations vector separately.
...
llvm-svn: 63070
2009-01-26 23:47:30 +00:00
Scott Michel
49483188c3
CellSPU:
...
- Update DWARF debugging support.
llvm-svn: 63059
2009-01-26 22:33:37 +00:00
Scott Michel
3789a13c30
Make the Dwarf macro information section optional; CellSPU's assembler
...
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.
llvm-svn: 63058
2009-01-26 22:32:51 +00:00
Dan Gohman
b6d36e1d14
Implement Red Zone utilization on x86-64. This is currently
...
disabled by default; I'll enable it when I hook it up with
the llvm-gcc flag which controls it.
llvm-svn: 63056
2009-01-26 22:22:31 +00:00
Owen Anderson
e84c3f261e
Reapply r63025 and r63026, with fixes for the failing testcases.
...
llvm-svn: 63049
2009-01-26 21:57:31 +00:00
Duncan Sands
d77e476921
Fix PR3393, which amounts to a bug in the expensive
...
checking logic. Rather than make the checking more
complicated, I've tweaked some logic to make things
conform to how the checking thought things ought to
be, since this results in a simpler "mental model".
llvm-svn: 63048
2009-01-26 21:54:18 +00:00
Ted Kremenek
a26699211d
Add method raw_fd_ostream::seek() for random access within a file.
...
llvm-svn: 63044
2009-01-26 21:42:04 +00:00
Bill Wendling
e7fa3c37c6
Also revert r63206
...
llvm-svn: 63041
2009-01-26 21:30:17 +00:00
Bill Wendling
a39c83d118
Temporarily revert r63025 until the testsuite failures can be fixed.
...
llvm-svn: 63040
2009-01-26 21:27:03 +00:00
Anton Korobeynikov
4b4622454c
During bittest switch lowering emit shift in the test block, which should (theoretically)
...
allow us to generate more efficient code. We don't do this now though :)
llvm-svn: 63027
2009-01-26 19:26:01 +00:00
Owen Anderson
5e235d3a7e
Get rid of a bunch of dead code now that interval reconstruction is enabled.
...
llvm-svn: 63026
2009-01-26 19:18:06 +00:00
Owen Anderson
feffdec244
Fix an issue where LiveIntervals was trying to be smart about removing kill
...
markers, and ended up foiling the interval reconstruction.
This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.
llvm-svn: 63025
2009-01-26 19:12:06 +00:00
Evan Cheng
6c7e85142b
Enhance logic in X86DAGToDAGISel::PreprocessForRMW which move load inside callseq_start to allow it to be folded into a call. It was not considering the cases where a token factor is between the load and the callseq_start.
...
llvm-svn: 63022
2009-01-26 18:43:34 +00:00
Evan Cheng
72287a599f
Silence a bogus compiler warning.
...
llvm-svn: 63021
2009-01-26 18:33:51 +00:00