Commit Graph

32137 Commits

Author SHA1 Message Date
Chris Lattner
4f8fb4973d turn on -experimental-asm-printer for x86 / AT&T by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 17:07:27 +00:00
Chris Lattner
13202deca6 reject attempts to take the address of an intrinsic, PR4949.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 17:05:29 +00:00
Andreas Neustifter
b1b4c0187b Bugfix. Sorry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 08:43:15 +00:00
Andreas Neustifter
8a58c180c2 Make ProfileEstimator even more robust on general CFGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 08:39:33 +00:00
Chris Lattner
9e6ffba26b switch HiddenGVStubs to be a DenseMap instead of a string map, mirroring FnStubs and GVStubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 07:03:20 +00:00
Chris Lattner
46091d70f5 Fix a bug I introduced in FnStubs generation, switch GVStubs to be a
densemap instead of StringMap to match FnStubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 06:59:18 +00:00
Chris Lattner
2a3c20bf26 change FnStubs from being a StringMap<std::string> to being a much
more efficient SmallPtrSet<MCSymbol*>.  This eliminates string
craziness and fixes CodeGen/X86/darwin-quote.ll with the new asmprinter.

Codegen is producing stubs in a nondeterminstic order, but it was doing
this before anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 06:36:33 +00:00
Chris Lattner
3e6bf2de16 printInstruction() no longer prints a \n after itself, do it
for the two instruction MOVPC32r sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:59:55 +00:00
Chris Lattner
a49ea86ba2 reimplement X86ATTAsmPrinter::GetGlobalAddressSymbol in terms of
Mangler::getNameWithPrefix.  In addition to avoiding some over
quoting, this also is more efficient because it uses smallvector
instead of std::string thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:58:44 +00:00
Chris Lattner
ceddb2b856 fix prefix ordering, it's L_foo not _Lfoo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:51:29 +00:00
Chris Lattner
5b7dfeebff add a new Mangler::getNameWithPrefix API which returns the
(uniqued if unnamed) global variable name with the prefix that
it is supposed to get.  It doesn't do "mangling" in the sense of
adding quotes and hacking on bad characters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:40:42 +00:00
Chris Lattner
a0602b4b14 convert X86ATTAsmPrinter::GetExternalSymbolSymbol to use SmallString
instead of std::string and Mangler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 04:36:43 +00:00
Chris Lattner
cf1ed75f7f rearrange some code, export a SmallString version of DecorateCygMingName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 04:28:13 +00:00
Evan Cheng
879caeadf3 Follow up to 81494. When the folded reload is narrowed to a 32-bit load then change the destination register to a 32-bit one or add a sub-register index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 01:01:31 +00:00
Evan Cheng
9cef48eae9 It's not legal to fold a load from a narrower stack slot into a wider instruction. If done, the instruction does a 64-bit load and that's not
safe. This can happen we a subreg_to_reg 0 has been coalesced. One
exception is when the instruction that folds the load is a move, then we
can simply turn it into a 32-bit load from the stack slot.                                                                                                                    

rdar://7170444


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:39:26 +00:00
Dan Gohman
4a215a13c3 Make fast-isel try ISD::FNEG before resorting to bitcasts and xors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:36:43 +00:00
Dan Gohman
5e5abb77fe Reapply r81171 with a fix: don't try to use i64 when it
isn't legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:34:46 +00:00
Dan Gohman
c24edfaee2 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:05:10 +00:00
Dan Gohman
3bfbc4587a Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:04:14 +00:00
Dan Gohman
e6992f728a Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:37:55 +00:00
Dan Gohman
83e3c4f9d7 Give these files top-level comments that describe the current code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:07:18 +00:00
Devang Patel
fa82441868 Fix whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:36:12 +00:00
Bob Wilson
92ad363f58 Don't swap the operands of a subtraction when trying to create a
post-decrement load/store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:09:31 +00:00
Dale Johannesen
db2659be58 Fix uppercaseo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 22:01:32 +00:00
Kevin Enderby
9c656450d6 Added the ParseInstruction() hook for target specific assembler directives so
that things like .word can be parsed as target specific.  Moved parsing .word
out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes
for other targets that support the .word directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 20:51:44 +00:00
Victor Hernandez
399e45b459 Fit code within 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 20:18:57 +00:00
Sean Callanan
7893ec6494 Added XOR instructions for rAX and immediates of
various widths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 19:52:26 +00:00
Sean Callanan
2f34a136b5 Added MOV instructions between rAX and memory offsets,
including segment offsets and (for 8-bit operands)
absolute offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 18:33:42 +00:00
Sean Callanan
1f24e01b87 Added a variety of PUSH and POP instructions, including
ones capable of accessing R/M operands instead of just
registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 18:29:13 +00:00
Bill Wendling
73c5a61725 Exit early if exception handling isn't supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 18:28:06 +00:00
Andreas Neustifter
0c0de66ea4 Make ProfileEstimator more robust on general CFGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:30:38 +00:00
Benjamin Kramer
b84c5ae3d4 Add some braces to make newer GCCs happy and update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 11:31:39 +00:00
Andreas Neustifter
b4b1c9fa23 Cleaned up code by factoring out common portions of edge loading into function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 07:12:35 +00:00
Nick Lewycky
fd5249e15b Correctly handle the case where a comparison is created in one BasicBlock and
used by a terminator in another.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 07:02:09 +00:00
Bill Wendling
28275fdf02 Comment and whitespace cleanups. No intentional functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 06:50:01 +00:00
Bill Wendling
a2f6449a57 Revert part of my r81424 patch. I removed what looked like superfluous padding
from the exception tables. However, Duncan explained why it's a can of worms to
do it the GCC way. I went back to doing it the LLVM way and added Duncan's
explanation so that I don't do this again in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 06:27:16 +00:00
Evan Cheng
fabcb9127f Add malloc call utility functions. Patch by Victor Hernandez.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 04:36:43 +00:00
Bill Wendling
fe220285b5 Don't hardcode the TType format size. In fact, rework the code so that it's more
like what GCC outputs. The mysterious code to insert padding wasn't in GCC at
all. I modified the TType base offset code to calculate the offset like GCC
does, though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 02:07:37 +00:00
Evan Cheng
08669746d0 Proper support of non-lazy indirect symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 01:23:53 +00:00
Bill Wendling
43e484fbcf Remove the "#if 0" that Noone loved. It wasn't really necessary, because the
code within it was the same inside and out. There's still a problem of the
TypeInfoSize should be the size of the TType format encoding (at least that's
what GCC thinks it should be).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 01:12:47 +00:00
Bob Wilson
2a16e6b22c Revert r81171 which was causing pr4927.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:49:22 +00:00
Bill Wendling
d1a5b37a62 Pull check for SJLJ EH into a boolean and use that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:17:04 +00:00
Bill Wendling
40121bccbe Use the SizeOfEncodedValue function instead of magic variables for the
sizeof(DW_EH_PE_udata4).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:13:16 +00:00
Bill Wendling
bb3e29932d Add helpful comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:04:48 +00:00
Bill Wendling
52783c63a1 Believe it or not, this is a simplification. :-)
Basically, this patch is working towards removing the hard-coded values that are
output for the CIE. In particular, the CIE augmentation and the CIE augmentation
size. Both of these should be calculated. In the process, I was able to make a
bunch of code simpler.

The encodings for the personality, LSDA, and FDE in the CIE are still not
correct. They should be generated either from target-specific callbacks (blech!)
or grokked from first-principles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:56:55 +00:00
Evan Cheng
10bf734e6e Fix double load / store multiple encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:55:03 +00:00
Chris Lattner
2a1744f553 canonicalize namespace gymnastics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:46:42 +00:00
Bob Wilson
cd3b9a4f17 Fix pr4939: Change FPCCToARMCC to translate SETOLE to ARMCC::LS.
See the bug report for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:14:54 +00:00
Chris Lattner
c5ea263a23 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:14:36 +00:00
Daniel Dunbar
ed6878842b Add comment re: clang dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:01:25 +00:00