Evan Cheng
6408cda38d
Move load / store folding alignment require into the table(s).
...
llvm-svn: 75749
2009-07-15 06:10:07 +00:00
Ted Kremenek
e6322544c4
Update CMake file.
...
llvm-svn: 75746
2009-07-15 05:39:55 +00:00
Chris Lattner
f90dad59d2
rename decorateName -> DecorateCygMingName, make it assert if not
...
cygming, make the two callers only call it if cygming. Other minor
cleanups.
llvm-svn: 75744
2009-07-15 04:55:56 +00:00
Chris Lattner
48e30f6d1f
eliminate the Mangler::PreserveAsmNames bit, the sole client of this
...
can do it perfectly well itself.
llvm-svn: 75743
2009-07-15 04:50:47 +00:00
Chris Lattner
ac3968ea1d
remove printSuffixedName.
...
llvm-svn: 75742
2009-07-15 04:42:49 +00:00
Chris Lattner
151877b93e
convert arm/darwin stubs to use the mangler to synthesize all the names instead of
...
doing it with printSuffixedName.
llvm-svn: 75741
2009-07-15 04:41:01 +00:00
Daniel Dunbar
cc2e2f1506
Add new TargetRegistry.
...
Targets implement a single global Target structure which will live in a new
<Target>/TargetInfo library; this will be present in any image which the target
is usable in.
- Optional target specific classes can then be registered and attached to the
Target description.
- Registration for normal Targets will be done via the initialization functions
instead of using static constructors.
- This allows clients to use a single interface to obtain target data, without
requiring the code generator be linked in. It also provides a natural
extension point for adding new optional target data (assembler parser,
disassembler, etc.).
- This also provides a new entry point for obtaining a target for a particular
triple (without a module).
- Not yet used, however this should eventually replace the TargetMachineRegistry.
llvm-svn: 75739
2009-07-15 04:24:58 +00:00
Chris Lattner
499fe29f12
fix an arm codegen bug (the same as PR4482 on ppc) where available_externally
...
symbols were not getting stubs. While I'm at it, add a big testcase for
stub generation to make sure I don't break anything.
llvm-svn: 75737
2009-07-15 04:12:33 +00:00
Chris Lattner
dd01e838c8
convert [Hidden]GVNonLazyPtrs to compute the global and stub names
...
with the mangler (like x86 and ppc), instead of going through
printSuffixedName.
llvm-svn: 75736
2009-07-15 03:12:43 +00:00
Chris Lattner
e65cf5546b
use makeNameProper to add the globalprefix instead of doing it manually.
...
llvm-svn: 75734
2009-07-15 03:01:23 +00:00
Chris Lattner
0c13774a29
get the PPC stub temporary label from the mangler instead of
...
using horrible string hacking. This gives us a different label,
but it's just an assembler temporary, so the name doesn't matter.
llvm-svn: 75733
2009-07-15 02:56:53 +00:00
Chris Lattner
0b4dc240bd
turn some if/then's into ?:
...
llvm-svn: 75732
2009-07-15 02:36:21 +00:00
Chris Lattner
34f25a514f
eliminate a bunch of printSuffixedName's by using info computed from
...
Mangler in FnStubs.
llvm-svn: 75731
2009-07-15 02:33:19 +00:00
Chris Lattner
5c6ad7d426
convert FnStubs to using a more structured form, eliminating
...
a couple instances of printSuffixedName (in favor of having
the mangler do stuff).
llvm-svn: 75729
2009-07-15 02:28:57 +00:00
Chris Lattner
4fd9c770a6
actually $stub labels *are* private, I just missed that
...
printSuffixedName automatically does this.
llvm-svn: 75727
2009-07-15 01:53:36 +00:00
Dan Gohman
6cc9cb6dc4
Fix indentation.
...
llvm-svn: 75723
2009-07-15 01:26:32 +00:00
Dan Gohman
81885d5b80
Make makeLoopInvariant report whether it made any changes or not,
...
and use this to simplify more code.
llvm-svn: 75722
2009-07-15 01:25:43 +00:00
Chris Lattner
84323b260d
$stub references should not be private ("L") labels.
...
llvm-svn: 75721
2009-07-15 01:23:13 +00:00
Chris Lattner
2f7a01f535
simplify "EmitExternalGlobal": it is only used to output a
...
reference to the personality function for a module, and
those are all added to the GVStubs array by looping
over MMI->getPersonalities()
llvm-svn: 75720
2009-07-15 01:16:38 +00:00
Chris Lattner
b43823c79d
Convert GVStubs and HiddenGVStubs to work more like the X86 backend, this
...
eliminates a bunch of uses of "printSuffixedName" and "getGlobalLinkName".
llvm-svn: 75719
2009-07-15 01:14:44 +00:00
Chris Lattner
441db03418
minor cleanups: only switch sections once before all function stubs, instead of
...
before each one.
llvm-svn: 75718
2009-07-15 00:55:58 +00:00
Kevin Enderby
3e47cf1dda
Added llvm-mc support for parsing the .include directive.
...
llvm-svn: 75711
2009-07-14 23:21:55 +00:00
Chris Lattner
0d3021c94c
minor syntax cleanup
...
llvm-svn: 75707
2009-07-14 23:14:10 +00:00
Owen Anderson
8c85061ee6
Move EVER MORE stuff over to LLVMContext.
...
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Daniel Dunbar
df466c8f3d
Fix path name.
...
llvm-svn: 75697
2009-07-14 22:58:03 +00:00
Bruno Cardoso Lopes
9aadad68e3
Use the right relocation type for X86::MOV64ri64i32
...
llvm-svn: 75687
2009-07-14 21:46:40 +00:00
Bob Wilson
fe2d3828e9
Fix bad indentation and 80-col violation.
...
llvm-svn: 75686
2009-07-14 21:45:58 +00:00
Kevin Enderby
5821cee99b
Added llvm-mc support for parsing the .lsym directive.
...
llvm-svn: 75685
2009-07-14 21:35:03 +00:00
David Goodwin
0d1423fb22
Check for PRE_INC and POST_INC.
...
llvm-svn: 75683
2009-07-14 21:29:29 +00:00
Dan Gohman
5329511fae
Fix the expansion of umax and smax in the case where one or more of
...
the operands have pointer type, so that the resulting type matches
the original SCEV type, and so that unnecessary ptrtoints are
avoided in common cases.
llvm-svn: 75680
2009-07-14 20:57:04 +00:00
Ted Kremenek
094e45cef0
Update CMake file.
...
llvm-svn: 75677
2009-07-14 20:44:17 +00:00
Chris Lattner
cd7477b173
fix David's merge conflict
...
llvm-svn: 75673
2009-07-14 20:25:40 +00:00
Chris Lattner
290c415b94
reapply r75408, which eliminates MOV64r0 in favor of using
...
MOV32r0 + subregs to do the same thing. This should work now
that PR4544 is fixed. Thanks Evan!
llvm-svn: 75671
2009-07-14 20:19:57 +00:00
David Greene
9c8a1b9b90
Have asm printers use formatted_raw_ostream directly to avoid a
...
dynamic_cast<>.
llvm-svn: 75670
2009-07-14 20:18:05 +00:00
Ted Kremenek
98ad0f7632
Update CMake file.
...
llvm-svn: 75666
2009-07-14 19:46:07 +00:00
David Goodwin
8cd9c88760
hasThumb2() does not mean we are compiling for thumb, must also check isThumb().
...
llvm-svn: 75660
2009-07-14 18:48:51 +00:00
Bob Wilson
8682c6607e
Remove an extra space.
...
llvm-svn: 75658
2009-07-14 18:44:34 +00:00
Torok Edwin
bbccd95874
Introduce a pointertracking pass.
...
For now this only computes the allocated size of the memory pointed to by a
pointer, and offset a pointer from allocated pointer.
The actual checkLimits part will come later, after another round of review.
llvm-svn: 75657
2009-07-14 18:44:28 +00:00
Bill Wendling
ee38e4e012
Mark as fall through.
...
llvm-svn: 75652
2009-07-14 18:30:04 +00:00
Chris Lattner
6ec578688d
Reapply my previous asmprinter changes now with more testing and two
...
additional bug fixes:
1. The bug that everyone hit was a problem in the asmprinter where it
would remove $stub but keep the L prefix on a name when emitting the
indirect symbol. This is easy to fix by keeping the name of the stub
and the name of the symbol in a StringMap instead of just keeping a
StringSet and trying to reconstruct it late.
2. There was a problem printing the personality function. The current
logic to print out the personality function from the DWARF information
is a bit of a cesspool right now that duplicates a bunch of other
logic in the asm printer. The short version of it is that it depends
on emitting both the L and _ prefix for symbols (at least on darwin)
and until I can untangle it, it is best to switch the mangler back to
emitting both prefixes.
llvm-svn: 75646
2009-07-14 18:17:16 +00:00
Kevin Enderby
0b1331c43b
Added llvm-mc support for parsing the .desc directive.
...
llvm-svn: 75645
2009-07-14 18:17:10 +00:00
Dale Johannesen
35fc3243a8
Revert 75571; I'm convinced this isn't the right thing to do.
...
llvm-svn: 75642
2009-07-14 17:48:25 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Daniel Dunbar
dbbc49bb29
Revert r7561{9,8,7,6}, which depend on r75610.
...
--- Reverse-merging r75619 into '.':
U lib/Target/DarwinTargetAsmInfo.cpp
U lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Reverse-merging r75618 into '.':
U lib/CodeGen/ELFWriter.cpp
U lib/CodeGen/MachOCodeEmitter.cpp
U lib/CodeGen/MachOWriter.cpp
--- Reverse-merging r75617 into '.':
U lib/Target/CBackend/CBackend.cpp
--- Reverse-merging r75616 into '.':
U tools/bugpoint/Miscompilation.cpp
U tools/lto/LTOCodeGenerator.cpp
U tools/lto/LTOModule.cpp
llvm-svn: 75638
2009-07-14 16:25:11 +00:00
Daniel Dunbar
84d593320b
Revert r75615, which depended on 75610.
...
--- Reverse-merging r75615 into '.':
U lib/Target/XCore/XCoreAsmPrinter.cpp
U lib/Target/PIC16/PIC16AsmPrinter.cpp
U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
U lib/Target/MSP430/MSP430AsmPrinter.cpp
U lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U lib/Target/MSIL/MSILWriter.cpp
U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
llvm-svn: 75637
2009-07-14 16:12:13 +00:00
Daniel Dunbar
3d0c94fbbc
Revert r75610 (and r75620, which was blocking the revert), in the hopes of
...
unbreaking llvm-gcc (on Darwin).
--- Reverse-merging r75620 into '.':
U include/llvm/Support/Mangler.h
--- Reverse-merging r75610 into '.':
U test/CodeGen/X86/loop-hoist.ll
G include/llvm/Support/Mangler.h
U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
U lib/VMCore/Mangler.cpp
llvm-svn: 75636
2009-07-14 15:57:55 +00:00
Dan Gohman
5069f6b40f
Make SCEVCallbackVH::allUsesReplacedWith more thorough in removing
...
users from the Scalars map.
llvm-svn: 75634
2009-07-14 14:34:04 +00:00
Dan Gohman
084661b1b5
Require IVUsers after LCSSA, since LCSSA does not preserve IVUsers.
...
This results in the pass manager running IVUsers only once for
indvars, instead of twice.
llvm-svn: 75633
2009-07-14 14:26:23 +00:00
Dan Gohman
e69947ca6e
Add a comment about why ScalarEvolution doesn't recognize non-loop PHIs
...
even when they're obvious.
llvm-svn: 75632
2009-07-14 14:06:25 +00:00
Torok Edwin
e5683aabc1
After converting assert(0) to LLVM_UNREACHABLE we lost file/line location.
...
Fix by making the LLVM_UNREACHABLE pass __FILE__ and __LINE__ to
llvm_unreachable.
llvm-svn: 75631
2009-07-14 12:49:22 +00:00
Torok Edwin
a73f9bdc2c
eliminate extra space.
...
llvm-svn: 75630
2009-07-14 12:22:58 +00:00
Anton Korobeynikov
503e689e52
Add extra sign extension to the same bit width before int sign
...
extension to another bit width. This is needed to get correct singed value.
Patch by Artur Pietrek!
llvm-svn: 75629
2009-07-14 09:53:14 +00:00
Anton Korobeynikov
80da762d21
Add missing break. Patch by Artur Pietrek!
...
llvm-svn: 75628
2009-07-14 09:52:47 +00:00
Daniel Dunbar
21b7f85dc3
ProfileInfo interface tweaks.
...
- Add getExecutionCount(const Function).
- Add helper Edge type.
- constify.
- No functionality change.
llvm-svn: 75623
2009-07-14 06:58:59 +00:00
Chris Lattner
b6fc9c6c54
rename getValueName -> getMangledName. These two files have very
...
dubious looking things that I need to investigate in more detail.
llvm-svn: 75619
2009-07-14 06:21:12 +00:00
Chris Lattner
21182d9727
Rename getValueName -> getMangledName
...
llvm-svn: 75618
2009-07-14 06:20:20 +00:00
Chris Lattner
bc4a4a1e6c
rename getValueName -> getMangledName
...
llvm-svn: 75617
2009-07-14 06:19:21 +00:00
Chris Lattner
8aa18612e2
Rename getValueName -> getMangledName.
...
llvm-svn: 75615
2009-07-14 06:18:50 +00:00
Bob Wilson
7c4dde989d
Fix an obvious error.
...
llvm-svn: 75611
2009-07-14 06:06:28 +00:00
Chris Lattner
b0e0d16efb
Change the X86 asmprinter to use the mangler to apply suffixes like "$non_lazy_ptr"
...
to symbols instead of doing it with "printSuffixedName". This gets us to the point
where there is a real separation between computing a symbol name and printing it,
something I need for MC printer stuff.
This patch also fixes a corner case bug where unnamed private globals wouldn't get
the private label prefix.
Next up, rename all uses of getValueName -> getMangledName for better greppability,
and then tackle the ppc/arm backends to eliminate "printSuffixedName".
llvm-svn: 75610
2009-07-14 06:04:35 +00:00
Chris Lattner
2a6bb9bc51
Change the internal interface to makeNameProper to take a bool that
...
indicates whether the label is private or not, instead of taking
prefix stuff. One effect of this is that symbols will be generated
with *just* the private prefix, instead of both the private prefix
*and* the user-label-prefix, but this doesn't matter as long as it
is consistent. For example we'll now get "Lfoo" instead of "L_foo".
These are just assembler temporary labels anyway, so they never even
make it into the .o file.
llvm-svn: 75607
2009-07-14 04:50:12 +00:00
Eli Friedman
63028801b8
Fix trivial todo in instcombine.
...
llvm-svn: 75586
2009-07-14 02:01:53 +00:00
Evan Cheng
b8666f7abc
1. In Thumb mode, select tBx instead of ARM variants.
...
2. BX does not "use" the link register, it defines it.
3. Fix a couple more places in thumb td file that still uses pre-UAL syntax.
llvm-svn: 75585
2009-07-14 01:49:27 +00:00
Dan Gohman
493855541b
Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariant
...
function.
llvm-svn: 75584
2009-07-14 01:37:59 +00:00
Bill Wendling
16502fbbcc
Remove hack now that Evan fixed it so that the frame pointer isn't saved twice.
...
llvm-svn: 75581
2009-07-14 01:16:18 +00:00
Dan Gohman
b9f3a3c96b
Fix indvars to not assume that a loop with a single unique exit
...
block has a single unique exiting block.
llvm-svn: 75579
2009-07-14 01:09:02 +00:00
Dan Gohman
80062e52e0
Introduce a new LoopInfo utility function makeLoopInvariant, which
...
works similar to isLoopInvariant, except that it will do trivial
hoisting to try to make the value loop invariant if it isn't already.
This makes it easier for transformation passes to clear trivial
instructions out of the way (the regular LICM pass doesn't run
until relatively late). This is code factored out of LoopSimplify
and other places.
llvm-svn: 75578
2009-07-14 01:06:29 +00:00
Chris Lattner
774d30003c
use getValueName instead of makeNameProper.
...
llvm-svn: 75577
2009-07-14 01:01:12 +00:00
David Goodwin
88f38c0380
Fix detection of valid BFC immediates.
...
llvm-svn: 75576
2009-07-14 00:57:56 +00:00
Devang Patel
4992f3bed3
Do not use Mangler to remove '1' from linkage name.
...
llvm-svn: 75574
2009-07-14 00:55:28 +00:00
Evan Cheng
9554d9840f
Fix pr4544. When remating, make sure the destination register fits the instruction definition. It may be mismatched due to sub-register coalescing.
...
No test case yet because the code doesn't trigger until 75408 is re-applied.
llvm-svn: 75572
2009-07-14 00:51:06 +00:00
Dale Johannesen
de1ed58935
Don't delete asm's just because their inputs are undefined;
...
xor R, R is a common and valid idiom for zeroing a register, for example.
llvm-svn: 75571
2009-07-14 00:45:38 +00:00
Dan Gohman
46fa731fe5
Add a newline, now that Value's operator<< doesn't print one.
...
llvm-svn: 75568
2009-07-14 00:32:49 +00:00
Dan Gohman
194a3c6000
FreeInst is trapping.
...
llvm-svn: 75567
2009-07-14 00:32:11 +00:00
Bob Wilson
a8d7dde3ce
Fix an obvious copy-and-paste error.
...
llvm-svn: 75566
2009-07-14 00:23:44 +00:00
Bob Wilson
cb91024983
Revert 75308.
...
llvm-svn: 75565
2009-07-14 00:16:03 +00:00
Chris Lattner
e7bf8a9cca
the mangler can never mangle intrinsics, don't allow this.
...
llvm-svn: 75564
2009-07-14 00:15:14 +00:00
Bob Wilson
4c76b1c7fc
Revert 75309.
...
llvm-svn: 75562
2009-07-14 00:01:42 +00:00
Chris Lattner
6460e403a7
rename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more
...
descriptive. Thange them to keep track of the ID of a global that is
assigned, not the first mangled name returned for it. Without doing this,
we are required to always use the same suffix for a global that gets
mangled. This means that we can mangle the same global once with $stub
and another time with $non_lazy_ptr or whatever.
llvm-svn: 75561
2009-07-14 00:01:06 +00:00
Owen Anderson
1404d6e7d1
Move more functionality over to LLVMContext.
...
llvm-svn: 75559
2009-07-13 23:50:59 +00:00
Chris Lattner
1b09927043
remove Mangler::getTypeID and related data, it was only used for mangling
...
local symbols and we haven't had type planes since llvm 1.9.
llvm-svn: 75558
2009-07-13 23:50:53 +00:00
Chris Lattner
4ea397f845
remove mangler support for mangling local names. Mangler should only be
...
used with globals.
llvm-svn: 75557
2009-07-13 23:47:27 +00:00
Chris Lattner
2a0ba70c02
fix CBE & MSIL backends to not use the mangler for non-global symbols.
...
llvm-svn: 75556
2009-07-13 23:46:46 +00:00
Chris Lattner
85170a73c8
don't print redundant @PLT suffixes
...
llvm-svn: 75554
2009-07-13 23:44:13 +00:00
Evan Cheng
7c051b0c6f
Revert an accidental commit.
...
llvm-svn: 75553
2009-07-13 23:44:01 +00:00
Chris Lattner
a7fc4621cd
the mangler should put suffixes on unnamed global's mangled names as well
...
if present.
llvm-svn: 75547
2009-07-13 23:20:38 +00:00
Owen Anderson
9ff3b6191e
Move a bit more functionality to LLVMContext, which apparently wasn't being used anyways.
...
llvm-svn: 75546
2009-07-13 23:16:26 +00:00
Kevin Enderby
af095fcfb8
Added llvm-mc support for parsing the .abort directive.
...
llvm-svn: 75545
2009-07-13 23:15:14 +00:00
Dan Gohman
fd3cc860ec
Print a newline after printing a Value, now that Value's operator<<
...
doesn't print a newline.
llvm-svn: 75543
2009-07-13 23:03:05 +00:00
Chris Lattner
1ab26071d4
Two changes:
...
1) unique globals with the existing "Count" local in Mangler, not with
atomic nonsense. Using atomics will give us nondeterminstic output
from the compiler when using multiple threads, which is bad.
2) Do not mangle an unknown global name with a type suffix. We don't
need this anymore now that llvm ir doesn't have type planes.
llvm-svn: 75541
2009-07-13 22:48:46 +00:00
Devang Patel
8af4ed78a9
Use assertion.
...
llvm-svn: 75540
2009-07-13 22:46:19 +00:00
Eli Friedman
a6c7a3d44e
PR4548: optimize zext+udiv+trunc to udiv.
...
llvm-svn: 75539
2009-07-13 22:46:01 +00:00
Owen Anderson
3e807fb553
Inline EvalVectorOp in order to get rid of passing-pointer-to-static-methods behavior.
...
llvm-svn: 75538
2009-07-13 22:41:06 +00:00
Bruno Cardoso Lopes
046ddf7ca0
Cleanup the global emission and refactor some code
...
llvm-svn: 75537
2009-07-13 22:40:39 +00:00
Chris Lattner
6ace4d4863
clean up some syntax.
...
llvm-svn: 75532
2009-07-13 22:28:21 +00:00
Eli Friedman
6b51ac6728
Canonicalize boolean +/- a constant to a select.
...
(I think it's reasonably clear that we want to have a canonical form for
constructs like this; if anyone thinks that a select is not the best
canonical form, please tell me.)
llvm-svn: 75531
2009-07-13 22:27:52 +00:00
Dan Gohman
5c3d16883e
Fix a few assertion strings.
...
llvm-svn: 75530
2009-07-13 22:20:53 +00:00
Dan Gohman
8e93bc202e
Forward-declare Loop and LoopInfo instead of #including LoopInfo.h.
...
llvm-svn: 75529
2009-07-13 22:19:41 +00:00
Owen Anderson
3501454313
These don't really need contexts either.
...
llvm-svn: 75528
2009-07-13 22:18:28 +00:00
Chris Lattner
2f4b2d3ea3
eliminate a bunch of code in print_pcrel_imm for printing symbols, using
...
printSymbolOperand instead.
llvm-svn: 75526
2009-07-13 22:07:30 +00:00
Dan Gohman
b8ec6716fd
Whitespace cleanups.
...
llvm-svn: 75525
2009-07-13 22:05:32 +00:00
Dan Gohman
370f5f3116
Fix an 80-column violation.
...
llvm-svn: 75524
2009-07-13 22:04:06 +00:00
Dan Gohman
9a7df22e10
Move isLCSSAForm, isLoopInvariant, getCanonicalInductionVariable,
...
and related functions out of LoopBase and into Loop, since they
are specific to BasicBlock-based loops. This also allows the code
to be moved out-of-line.
llvm-svn: 75523
2009-07-13 22:02:44 +00:00
Chris Lattner
734c817d24
move a method and add a comment, no functionality change.
...
llvm-svn: 75520
2009-07-13 21:53:19 +00:00
Dan Gohman
f6caa6f1e3
Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,
...
using the Curiously Recurring Template Pattern with LoopBase.
This will help further refactoring, and future functionality for
Loop. Also, Headers can now foward-declare Loop, instead of pulling
in LoopInfo.h or doing tricks.
llvm-svn: 75519
2009-07-13 21:51:15 +00:00
Chris Lattner
1c9a2afaa9
refactor operand printing to remove hte last of the "mem" modifier hack. The
...
only remaining modifier is "subreg".
llvm-svn: 75516
2009-07-13 21:48:33 +00:00
Devang Patel
af27c5b2bd
Use AsmPrinter's Mangler to remove leading '1' from linkage names.
...
llvm-svn: 75515
2009-07-13 21:48:26 +00:00
Eli Friedman
b2a8c4ffc9
Misc simplifications to InstCombiner::commonIntCastTransforms. Most of
...
the changes are allowed by not calling this function for bitcasts.
The Instruction::AShr case is dead because
SimplifyDemandedInstructionBits handles that case.
llvm-svn: 75514
2009-07-13 21:45:57 +00:00
David Goodwin
9634e3ff8f
Fix FP elimination code to work for Thumb-2 addrmode AddrModeT2_so. This fixes SingleSource/Benchmarks/Stanford/Queens (among others).
...
llvm-svn: 75513
2009-07-13 21:43:08 +00:00
Chris Lattner
575e7ab711
refactor symbol printing so the whole "mem" thing is handled in fewer places.
...
llvm-svn: 75512
2009-07-13 21:41:08 +00:00
Dan Gohman
a9953c0a28
Reapply 75252, with a fix to avoid the infinite recursion case. The
...
check for avoiding re-analyzing a widening cast needed to happen
earlier, as getSCEV itself may result in a isLoopGuardedByCond query.
llvm-svn: 75511
2009-07-13 21:35:55 +00:00
Owen Anderson
7b2ee7dc21
As Chris pointed out, this doesn't actually need an LLVMContext to operate.
...
llvm-svn: 75508
2009-07-13 21:27:19 +00:00
Devang Patel
f1387bc427
revert rev. 75503 for now.
...
llvm-svn: 75507
2009-07-13 21:26:33 +00:00
Devang Patel
ca075d2f7a
Use Mangler to remove leading '1' from linkage names.
...
llvm-svn: 75503
2009-07-13 21:19:56 +00:00
Kevin Enderby
a461788d6a
add llvm-mc support for parsing the .subsections_via_symbols directive.
...
llvm-svn: 75500
2009-07-13 21:03:15 +00:00
Eli Friedman
baf7e04afa
Fix comment.
...
llvm-svn: 75499
2009-07-13 20:58:59 +00:00
Owen Anderson
1e5155161a
Move more functionality over to LLVMContext.
...
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Dan Gohman
1a780ad8db
Move the memoization check for SCEVSignExtendExpr and
...
SCEVZeroExtendExpr ahead of the most expensive analysis. This
speeds up analysis and helps avoid pathologically bad behavior
on the testcase in PR4534.
llvm-svn: 75496
2009-07-13 20:55:53 +00:00
Eli Friedman
832f33550c
Don't bother to call commonIntCastTransforms for bitcasts; int->int
...
bitcasts will always be eliminated anyway.
llvm-svn: 75495
2009-07-13 20:53:00 +00:00
Dan Gohman
bf3719359b
Convert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminates
...
a bunch of redundent code in Profile methods, and prepares for upcoming
changes to do improved memoization.
llvm-svn: 75494
2009-07-13 20:50:19 +00:00
Bill Wendling
d7ca276d9f
Reverted r75484. It was causing a failure with Apple-style builds.
...
llvm-svn: 75491
2009-07-13 20:27:41 +00:00
David Greene
814f6a648f
Add infrastructure to allow post instruction printing action triggers.
...
We'll eventually use this to print comments in asm files and do other
fun things.
This adds interfaces to the AsmPrinter and changes TableGen to invoke
the postInstructionAction when appropriate. It also add parameters to
TargetAsmInfo to control comment layout.
llvm-svn: 75490
2009-07-13 20:25:48 +00:00
Chris Lattner
adc834d034
Add NetBSD to the Triple class, patch by Krister Walfridsson!
...
llvm-svn: 75489
2009-07-13 20:22:23 +00:00
Bill Wendling
1f26277c9b
More standard way of specifying greater than Leopard.
...
llvm-svn: 75488
2009-07-13 20:18:43 +00:00
Bill Wendling
4ef26e9b22
On greater than Leopard systems, place exception tables in the __TEXT section.
...
llvm-svn: 75484
2009-07-13 18:48:39 +00:00
Dan Gohman
21f79b4239
Change printInstruction to not print a trailing newline. Value::dump
...
always adds a newline, so this fixes Value::dump printing an
extra blank line.
llvm-svn: 75481
2009-07-13 18:27:59 +00:00
Bob Wilson
e0478ff8e5
Fix comment typos.
...
llvm-svn: 75479
2009-07-13 18:11:36 +00:00
Chris Lattner
11cf698cf7
factor the 'optimized sort' code out into a static helper function
...
and use it from one more place. Patch by Jakub Staszak!
llvm-svn: 75478
2009-07-13 17:20:05 +00:00
Chris Lattner
b4bd955891
Move the re-sort of invalidated NonLocalPointerDeps cache earlier
...
so that all code paths get it. PR4256 was about a case where the
phi translation loop would find all preds in the Visited cache, so
it could get by without re-sorting the NonLocalPointerDeps cache.
Fix this by resorting it earlier, there is no reason not to do this.
This patch inspired by Jakub Staszak's patch.
llvm-svn: 75476
2009-07-13 17:14:23 +00:00
David Greene
0dbe5b0a97
Make some more changes suggested by Chris. Manipulators go away.
...
llvm-svn: 75472
2009-07-13 16:49:27 +00:00
Daniel Dunbar
060ce73124
Match declaration to definition (missed a few).
...
llvm-svn: 75456
2009-07-13 06:04:06 +00:00
Daniel Dunbar
cf2cfb50d3
Match declaration to definition.
...
llvm-svn: 75454
2009-07-13 06:00:13 +00:00
Nick Lewycky
673f3dbbd7
Fix build on Linux.
...
llvm-svn: 75453
2009-07-13 05:49:04 +00:00
Daniel Dunbar
fdc557472e
Fix some non-sensical code.
...
- This makes it more like other similar code in Archive handling.
llvm-svn: 75452
2009-07-13 05:29:34 +00:00
Daniel Dunbar
8338833066
Switch to raw_ostream.
...
llvm-svn: 75451
2009-07-13 05:27:30 +00:00
Lang Hames
c1b01a178f
Removed some junk code that snuck in to an earlier commit.
...
llvm-svn: 75450
2009-07-13 05:01:19 +00:00
Nick Lewycky
0cc1d245c4
Fix an error in ConstantRange::getSignedMax on wrapped ranges. Thanks once
...
again to Daniel Dunbar and KLEE!
llvm-svn: 75449
2009-07-13 04:50:21 +00:00
Nick Lewycky
41a9bdab7b
'i8 full-range' sign extended to i16 should equal [-128, 128) not [-128, 127).
...
Found by Daniel Dunbar and KLEE.
llvm-svn: 75448
2009-07-13 04:17:23 +00:00
Owen Anderson
393d8b0a0c
Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
...
This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.
llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Nick Lewycky
fee90bcb80
Multiply was very wrong for wrapped ranges. This supplies a half-fix that will
...
generally return Full on all wrapped inputs. "Fixes" PR4545.
llvm-svn: 75444
2009-07-13 03:27:41 +00:00
Nick Lewycky
7280c39dc7
Fix a bug summing two full sets. The overflow checking doesn't handle sets as
...
large as the full set, only those one size smaller. Thanks to Daniel Dunbar
who found this bug using Klee!
llvm-svn: 75443
2009-07-13 02:49:08 +00:00
Daniel Dunbar
c6592df02d
Match declaration to definition.
...
llvm-svn: 75440
2009-07-12 23:50:34 +00:00
Chris Lattner
d3eba0efb8
remove llvm.part.set.* and llvm.part.select.*. They have never been
...
implemented in codegen, have no frontend to generate them, and are
better implemented with pattern matching (like the ppc backend does
to generate rlwimi/rlwinm etc).
PR4543
llvm-svn: 75430
2009-07-12 21:08:53 +00:00
Daniel Dunbar
4aa12d4330
Use llvm_report_error, not llvm_unreachable.
...
llvm-svn: 75429
2009-07-12 21:01:49 +00:00
Daniel Dunbar
995f9a8a15
Improve sys::Path::makeAbsolute on Win32.
...
- Patch by Viktor Kutuzov!
- Minor tweak by me to add llvm_unreachable calls on FIXMEd error paths.
llvm-svn: 75424
2009-07-12 20:23:56 +00:00
Torok Edwin
67153904ec
Fix assert(0) conversion, as suggested by Chris.
...
llvm-svn: 75423
2009-07-12 20:07:01 +00:00
Chris Lattner
cf99e77cc3
"UNIX paths can contain non-ASCII characters, so Path::isValid() should not reject paths with such characters in them. The attached patch removes the check from Path::isValid()."
...
patch by Benjamin Kramer!
llvm-svn: 75421
2009-07-12 19:01:16 +00:00
Jakob Stoklund Olesen
8511b1d5ad
Implement support for promotion of AND/OR/XOR on integer types.
...
The blackfin processor has a legal i16 type, but only logic operations on i32.
llvm-svn: 75419
2009-07-12 18:10:18 +00:00
Jakob Stoklund Olesen
2792392244
Fix types in PromoteNode handling of CTPOP and friends.
...
llvm-svn: 75418
2009-07-12 17:43:20 +00:00
Torok Edwin
62902fd6c8
Remove extra \n from LLVM_UNREACHABLE calls.
...
llvm-svn: 75416
2009-07-12 07:15:17 +00:00
Nick Lewycky
dc5ef94320
Implement udiv for ConstantRanges.
...
llvm-svn: 75413
2009-07-12 05:18:18 +00:00
Bill Wendling
dcf4c8e237
Temporarily revert r75408. It appears to break the Apple-style builds:
...
x86_64-apple-darwin10-gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -mdynamic-no-pic -DHAVE_CONFIG_H -I. -I. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include -I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~dst/Developer/usr/local/include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~obj/src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~dst/Developer/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO='"9999"' -DBUILD_LLVM_APPLE_STYLE /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/tree-ssa-alias.c -o tree-ssa-alias.o
/var/tmp//ccJQ2JBT.s:4134:Incorrect register `%rcx' used with `l' suffix
make[2]: *** [tree-ssa-live.o] Error 1
make[2]: *** Waiting for unfinished jobs....
llvm-svn: 75412
2009-07-12 02:49:22 +00:00
Nick Lewycky
6663d6ad6f
Implement ConstantRange::multiply based on the code in LoopVR.
...
llvm-svn: 75410
2009-07-12 02:19:05 +00:00
Eli Friedman
8c0118042a
Remove check which is duplicated in
...
InstCombiner::visitSelectInstWithICmp.
llvm-svn: 75409
2009-07-12 02:00:05 +00:00
Chris Lattner
83effafb6b
eliminate MOV64r0 in favor of a Pat<> pattern. This is only nontrivial because
...
the div lowering code explicitly references it.
llvm-svn: 75408
2009-07-12 00:47:55 +00:00
Chris Lattner
a54c70286c
fix x86-64 static codegen to materialize the address of a global with movl instead
...
of lea. It is better for code size (and presumably efficiency) to use:
movl $foo, %eax
rather than:
leal foo, eax
Both give a nice zero extending "move immediate" instruction, the former is just
smaller. Note that global addresses should be handled different by the x86
backend, but I chose to follow the style already in place and add more fixme's.
llvm-svn: 75403
2009-07-11 23:17:29 +00:00
Chris Lattner
3ab73a2545
fix a bug in my cleanup patch
...
llvm-svn: 75402
2009-07-11 23:07:30 +00:00
Chris Lattner
4902f811b6
comment cleanup, reduce nesting.
...
llvm-svn: 75398
2009-07-11 22:50:33 +00:00
Chris Lattner
2af5f2aeca
remove some dead patterns, WrapperRIP doesn't exist in -static mode
...
anymore, so these aren't needed.
llvm-svn: 75397
2009-07-11 22:47:21 +00:00
Chris Lattner
edf6f031d8
silence a vc++ warning.
...
llvm-svn: 75393
2009-07-11 22:31:59 +00:00
Nick Lewycky
d3d5cfa475
Revert r75252 which was causing some crashes at compile time.
...
llvm-svn: 75384
2009-07-11 20:38:25 +00:00
Chris Lattner
496f872969
Fix PR4533, which is about buggy codegen in x86-64 -static mode.
...
Basically, using:
lea symbol(%rip), %rax
is not valid in -static mode, because the current RIP may not be
within 32-bits of "symbol" when an app is built partially pic and
partially static. The fix for this is to compile it to:
lea symbol, %rax
It would be better to codegen this as:
movq $symbol, %rax
but that will come next.
The hard part of fixing this bug was fixing abi-isel, which was actively
testing for the wrong behavior. Also, the RUN lines are completely impossible
to understand what they are testing. To help with this, convert the -static
x86-64 codegen tests to use filecheck. This is much more stable and makes it
more clear what the codegen is expected to be.
llvm-svn: 75382
2009-07-11 20:29:19 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Mikhail Glushenkov
8ce78c596d
Delete the temp dir even when '--temp-dir' is specified.
...
llvm-svn: 75374
2009-07-11 19:27:07 +00:00
Nick Lewycky
3e43cd4105
Fix handling of max and full set.
...
A full set is a constant range that represents any number. If you take the
umax of that and [5, 10) you end up with [5, INT_MAX] because the values less
than 5 would be umax's against a value which is at least 5.
llvm-svn: 75372
2009-07-11 19:22:21 +00:00
Nick Lewycky
58a6fd9824
Clarify and simplify.
...
llvm-svn: 75366
2009-07-11 17:04:01 +00:00
Torok Edwin
9b41a5faf2
Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
...
and abort()/exit() -> llvm_report_error().
llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Evan Cheng
20086680b0
Don't put IT instruction before conditional branches.
...
llvm-svn: 75361
2009-07-11 07:26:20 +00:00
Evan Cheng
03d981d91b
Smarter isel of ldrsb / ldrsh. Only make use of these when [r,r] address is feasible.
...
llvm-svn: 75360
2009-07-11 07:08:13 +00:00
Evan Cheng
268b47b1fb
Major changes to Thumb (not Thumb2). Many 16-bit instructions either modifies CPSR when they are outside the IT blocks, or they can predicated when in Thumb2. Move the implicit def of CPSR to an optional def which defaults CPSR. This allows the 's' bit to be toggled dynamically.
...
A side-effect of this change is asm printer is now using unified assembly. There are some minor clean ups and fixes as well.
llvm-svn: 75359
2009-07-11 06:43:01 +00:00
Evan Cheng
e83b947a2c
80 col violation.
...
llvm-svn: 75358
2009-07-11 06:37:27 +00:00
Nick Lewycky
fee40fdcd9
Move a method that creates constant ranges relative to another constant range
...
per icmp predicate out of predsimplify and into ConstantRange.
Add another utility method that determines whether one range is a subset of
another. Combine with the former to determine whether icmp pred range, range
is known to be true or not.
llvm-svn: 75357
2009-07-11 06:15:39 +00:00
Evan Cheng
9d134d08dc
Fix up support for OptionalDefOperand when it defaults to an actual register def. I need this to get ready for major Thumb1 surgery.
...
llvm-svn: 75328
2009-07-11 01:06:50 +00:00
Eli Friedman
2d27c23fb6
Use CreateStackStoreLoad helper in more places.
...
llvm-svn: 75320
2009-07-11 00:11:07 +00:00
Evan Cheng
8a86ec9857
Two-address pass should use findCommutedOpIndices to determine what registers are commuted.
...
llvm-svn: 75317
2009-07-11 00:04:23 +00:00
Evan Cheng
84a8e5aadc
Use findCommutedOpIndices to find the operands to commute.
...
llvm-svn: 75312
2009-07-10 23:26:12 +00:00
Bob Wilson
88593195a0
Add superclasses of ARM Neon quad registers. The Q2PR class contains pairs of
...
quad registers and the Q4PR class holds sets of 4 quad registers.
llvm-svn: 75309
2009-07-10 23:09:06 +00:00
Bob Wilson
48729a2025
Add new vector types for 192-bit, 348-bit and 512-bit sizes.
...
These are needed to represent ARM Neon struct datatypes containing 2, 3 or 4
separate vectors.
llvm-svn: 75308
2009-07-10 23:05:09 +00:00
Chris Lattner
a403645785
remove the "debug" modifier, it is only used by one instruction which can
...
never be generated.
llvm-svn: 75305
2009-07-10 22:34:11 +00:00
Chris Lattner
84bf9fed2b
add support for .zerofill, patch by Kevin Enderby!
...
llvm-svn: 75301
2009-07-10 22:20:30 +00:00
Jeffrey Yasskin
0f896380f6
Oops. s/#if defined(USE_OPROFILE)/#if USE_OPROFILE/. We #define
...
USE_OPROFILE to 0 on some paths through configure, which does the
wrong thing with #if defined().
llvm-svn: 75300
2009-07-10 22:13:21 +00:00
Chris Lattner
70881971d2
make pcrel and non-pcrel global printing more similar.
...
llvm-svn: 75298
2009-07-10 21:57:21 +00:00
Evan Cheng
94967abfe3
Undo my brain cramp.
...
llvm-svn: 75290
2009-07-10 21:31:42 +00:00
David Greene
a60479705b
Make changes suggested by Chris and eliminate newly-added raw_ostream
...
hooks as they're no longer needed.
The major change with this patch is to make formatted_raw_ostream usable
by any client of raw_ostream.
llvm-svn: 75283
2009-07-10 21:14:44 +00:00
Jeffrey Yasskin
4f8961d587
Add a --with-oprofile flag to configure, which uses OProfile's agent
...
library to tell it the addresses of JITted functions. For a
particular program, this changes the opreport -l output from:
samples % image name symbol name
48182 98.9729 anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000)
11 0.0226 libstdc++.so.6.0.9 /usr/lib/libstdc++.so.6.0.9
to:
samples % image name symbol name
24565 60.7308 19814.jo fib_left
15365 37.9861 19814.jo fib_right
22 0.0544 ld-2.7.so do_lookup_x
llvm-svn: 75279
2009-07-10 21:08:20 +00:00
Chris Lattner
1781e322d7
code model is never set to default.
...
llvm-svn: 75278
2009-07-10 21:03:06 +00:00
Chris Lattner
4b7ff8e0c0
fix indentation
...
llvm-svn: 75277
2009-07-10 21:01:59 +00:00
Chris Lattner
478fc8442b
remove the now-dead TM argument to these methods.
...
llvm-svn: 75276
2009-07-10 21:00:45 +00:00
Chris Lattner
9c13214ee8
make PIC vs DynamicNoPIC be explicit in PICStyles.
...
llvm-svn: 75275
2009-07-10 20:58:47 +00:00
Chris Lattner
933108f921
some minor simplifications.
...
llvm-svn: 75274
2009-07-10 20:53:38 +00:00
Chris Lattner
9deef50410
add a couple of predicates to test for "stub style pic in PIC mode" and "stub style pic in dynamic-no-pic" mode.
...
llvm-svn: 75273
2009-07-10 20:47:30 +00:00
Dan Gohman
5749595b5b
Remove ScalarEvolution::hasSCEV, which isn't being used, and which
...
breaks encapsulation. Also remove a dead prototype for setSCEV.
llvm-svn: 75272
2009-07-10 20:25:29 +00:00
Duncan Sands
f32be25f82
Avoid compiler warnings when assertions are turned off.
...
llvm-svn: 75269
2009-07-10 20:10:14 +00:00
Duncan Sands
fff8443450
Avoid compiler warnings if assertions turned off.
...
llvm-svn: 75267
2009-07-10 20:07:07 +00:00
Evan Cheng
7f57128609
CMOVxx doesn't swap operands which it's commuted.
...
llvm-svn: 75266
2009-07-10 19:26:57 +00:00
Evan Cheng
52ce32d097
Remove TargetInstrInfo::CommuteChangesDestination and added findCommutedOpIndices which returns the operand indices which are swapped (when applicable). This allows for some code clean up and future enhancements.
...
llvm-svn: 75264
2009-07-10 19:15:51 +00:00
David Greene
c6a6fb7906
Eliminate an unnecessary include.
...
llvm-svn: 75256
2009-07-10 17:55:38 +00:00
Owen Anderson
7076f1ffb7
Push LLVMContext through the PatternMatch API.
...
llvm-svn: 75255
2009-07-10 17:35:01 +00:00
David Goodwin
1a6f4f6f8d
Predicate VFP instructions on HasVFP2 instead of IsARM. This allows VFP instructions with thumb-2.
...
llvm-svn: 75254
2009-07-10 17:03:29 +00:00
Dan Gohman
404a92e330
Generalize ScalarEvolution's cast-folding code to support more kinds
...
of loops. Add several new functions to for working with ScalarEvolution's
add-hoc value-range analysis functionality.
llvm-svn: 75252
2009-07-10 16:42:52 +00:00