Chris Lattner
f270618038
Fix a long-standing bug and misfeature of the disassembler: when dealing with a
...
stripped .bc file, it didn't make any attempt to try to reuse anonymous types.
This causes an amazing type explosion due to types getting duplicated everywhere
they are referenced and other problems.
This also caused correctness issues, because opaque types are unique for each time
they are uttered in the file. This means that stripping a .bc file could produce
a .ll file that could not be assembled (e.g. 2009-02-28-StripOpaqueName.ll).
This patch fixes both of these issues.
llvm-svn: 65738
2009-03-01 00:03:38 +00:00
Chris Lattner
1a7eac8434
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
666bf65fa3
switch to densemap for pointer->word map.
...
llvm-svn: 65735
2009-02-28 23:03:55 +00:00
Chris Lattner
2396ce476a
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
2b04164c1d
make this work when constructed with a null module*
...
llvm-svn: 65733
2009-02-28 23:01:30 +00:00
Chris Lattner
03e16b833f
expose TypePrinting as a public API.
...
llvm-svn: 65729
2009-02-28 22:34:45 +00:00
Chris Lattner
5b8bf4f327
rename 'Result' to 'OS' in CalcTypeName for consistency
...
llvm-svn: 65724
2009-02-28 21:27:31 +00:00
Chris Lattner
5eaaf4a96d
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
e0a45a4296
stop calling Type::getDescription().
...
llvm-svn: 65722
2009-02-28 21:18:43 +00:00
Chris Lattner
c75ef1bf12
simplifications
...
llvm-svn: 65721
2009-02-28 21:11:05 +00:00
Chris Lattner
f47615197e
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
9e0c90d568
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
e89d5cf8ea
remove a bunch of nearly-duplicated code.
...
llvm-svn: 65715
2009-02-28 20:40:29 +00:00
Chris Lattner
6a44ecb340
fix indentation, remove dead integer case.
...
llvm-svn: 65714
2009-02-28 20:35:42 +00:00
Chris Lattner
ad8d445e97
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
e0fb715ace
inline method into its only use and simplify the result.
...
llvm-svn: 65712
2009-02-28 20:31:14 +00:00
Chris Lattner
0d6a6602c5
simplify condition
...
llvm-svn: 65711
2009-02-28 20:28:50 +00:00
Chris Lattner
9fd658a250
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
af8467a57f
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
9c3ce7905e
Last commit accidentially deleted this code.
...
llvm-svn: 65679
2009-02-28 06:02:14 +00:00
Mon P Wang
0258a27c5a
Added another darwin subtarget
...
llvm-svn: 65662
2009-02-28 00:25:30 +00:00
Devang Patel
c908eb0dba
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
880e63bf01
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
9b51fe4ab1
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
44b8675102
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
f5563f28d3
Fix compiler warning about uninitialized variables. No functional change.
...
llvm-svn: 65620
2009-02-27 06:29:31 +00:00
Dale Johannesen
8f76578347
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
0ca6e3dba5
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
670d50e102
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
32d31bc5cc
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
4014a9a5b8
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
86fc9440db
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
435dbd4665
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
ec34226c2b
Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.
...
llvm-svn: 65482
2009-02-25 22:49:59 +00:00
Dale Johannesen
9a6ca304f1
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
2fd41ecef5
Print variable's display name in dwarf DIE.
...
llvm-svn: 65468
2009-02-25 19:41:35 +00:00
Chris Lattner
1443cb8f77
Fix PR3667
...
llvm-svn: 65464
2009-02-25 18:20:01 +00:00
Zhou Sheng
241d74737b
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
befebff8fc
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
8672fb675c
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
3f273a8412
Expand tabs to spaces (overlooked in previous commit)
...
llvm-svn: 65427
2009-02-25 03:57:49 +00:00
Scott Michel
29d7559c09
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
c9b4dab417
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
936c18daca
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
d5e0934e30
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
dd9c79d45b
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
9d4eb136da
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
ffcb59129f
Add a debugging option for SSC DCE.
...
llvm-svn: 65375
2009-02-24 05:44:18 +00:00
Bill Wendling
0d8316c5e0
- 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
1197d46ccf
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