Commit Graph

4495 Commits

Author SHA1 Message Date
Chris Lattner
b09d2ccc0f Rename getValueName -> getMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 06:18:50 +00:00
Chris Lattner
03e9dd9ffa 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".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 06:04:35 +00:00
Bill Wendling
7d43cd8f3e Remove hack now that Evan fixed it so that the frame pointer isn't saved twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 01:16:18 +00:00
Chris Lattner
b9e126ce7d use getValueName instead of makeNameProper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 01:01:12 +00:00
Chris Lattner
6dea8d31d3 don't print redundant @PLT suffixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 23:44:13 +00:00
Chris Lattner
e2959dc2b1 clean up some syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 22:28:21 +00:00
Chris Lattner
62c5c5099c eliminate a bunch of code in print_pcrel_imm for printing symbols, using
printSymbolOperand instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 22:07:30 +00:00
Chris Lattner
f666c094e9 move a method and add a comment, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:53:19 +00:00
Chris Lattner
92aa0bb4ca refactor operand printing to remove hte last of the "mem" modifier hack. The
only remaining modifier is "subreg".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:48:33 +00:00
Chris Lattner
174f816f30 refactor symbol printing so the whole "mem" thing is handled in fewer places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 21:41:08 +00:00
Owen Anderson
73c6b7127a Move more functionality over to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:58:05 +00:00
Bill Wendling
db425496a6 Reverted r75484. It was causing a failure with Apple-style builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:27:41 +00:00
Bill Wendling
892838336c More standard way of specifying greater than Leopard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 20:18:43 +00:00
Bill Wendling
b6be139c50 On greater than Leopard systems, place exception tables in the __TEXT section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 18:48:39 +00:00
Owen Anderson
0a5372ed3e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:09:18 +00:00
Torok Edwin
29fd056d81 Remove extra \n from LLVM_UNREACHABLE calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 07:15:17 +00:00
Bill Wendling
69600cae95 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....



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 02:49:22 +00:00
Chris Lattner
a6d16ae432 eliminate MOV64r0 in favor of a Pat<> pattern. This is only nontrivial because
the div lowering code explicitly references it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 00:47:55 +00:00
Chris Lattner
65a7a6f7a3 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 23:17:29 +00:00
Chris Lattner
14f7511f46 fix a bug in my cleanup patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 23:07:30 +00:00
Chris Lattner
2514278b83 comment cleanup, reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 22:50:33 +00:00
Chris Lattner
a3c8d38795 remove some dead patterns, WrapperRIP doesn't exist in -static mode
anymore, so these aren't needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 22:47:21 +00:00
Chris Lattner
4f06649497 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:29:19 +00:00
Torok Edwin
c25e7581b9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Chris Lattner
226b60827e remove the "debug" modifier, it is only used by one instruction which can
never be generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 22:34:11 +00:00
Chris Lattner
7a4e464da2 make pcrel and non-pcrel global printing more similar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:57:21 +00:00
Evan Cheng
19a2011194 Undo my brain cramp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:31:42 +00:00
Chris Lattner
f1d6bd5cbe code model is never set to default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:03:06 +00:00
Chris Lattner
c7822326df fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:01:59 +00:00
Chris Lattner
e2c920845a remove the now-dead TM argument to these methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 21:00:45 +00:00
Chris Lattner
8097b65c43 make PIC vs DynamicNoPIC be explicit in PICStyles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 20:58:47 +00:00
Chris Lattner
84853a17a3 some minor simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 20:53:38 +00:00
Chris Lattner
3b67e9ba01 add a couple of predicates to test for "stub style pic in PIC mode" and "stub style pic in dynamic-no-pic" mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 20:47:30 +00:00
Evan Cheng
49ddb61612 CMOVxx doesn't swap operands which it's commuted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 19:26:57 +00:00
Chris Lattner
662b805a0a make this more like printOperand. Perhaps some merging will happen
tomorrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:50:52 +00:00
Chris Lattner
0d786dd954 simplify fast isel by using ClassifyGlobalReference. This
elimiantes the last use of GVRequiresExtraLoad, so delete it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:48:51 +00:00
Chris Lattner
dfed413ef6 eliminate GVRequiresRegister, replacing it with predicates we
need for other purposes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:38:24 +00:00
Chris Lattner
36c2501121 change a bunch of logic in LowerGlobalAddress to leverage the work
done in ClassifyGlobalReference instead of reconstructing the info
awkwardly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:34:39 +00:00
Chris Lattner
7478ab8502 add a predicate to determine if a global var reference requires a
PIC-base to be added in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:33:30 +00:00
Chris Lattner
d392bd97c8 move some classification logic around. Now GVRequiresExtraLoad
is just a trivial wrapper around "ClassifyGlobalReference", which
stole a ton of logic from LowerGlobalAddress.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 07:20:05 +00:00
Chris Lattner
3b6b36d6f5 change isGlobalStubReference to take target flags instead of a MachineOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 06:29:59 +00:00
Chris Lattner
07406346eb convert some late code (called by regalloc and code emission)
to use isGlobalStubReference instead of GVRequiresExtraLoad
(which should really be part of isel).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 06:07:08 +00:00
Chris Lattner
281bada3b0 add a new predicate method that says whether a GlobalValue
MachineOperand is a reference to a stub, not a reference to the
global variable itself.  Look no context needed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 06:06:17 +00:00
Chris Lattner
ed0dca6a5d GVRequiresExtraLoad is now never used for calls, simplify it based on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:52:02 +00:00
Chris Lattner
754b7650c2 actually, just eliminate PCRelGVRequiresExtraLoad. It makes the code
more complex and slow than just directly testing what we care about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:48:03 +00:00
Chris Lattner
e6c07b52e7 There is only one case where GVRequiresExtraLoad returns true for calls:
split its handling out to PCRelGVRequiresExtraLoad, and simplify code
based on this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:45:15 +00:00
Chris Lattner
04b304caf6 the "isDirectCall" operand of GVRequiresRegister is always false, eliminate it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:37:11 +00:00
Chris Lattner
0aa43de1d0 split call handling out of X86SelectAddress into X86SelectCallAddress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:33:42 +00:00
Chris Lattner
8a537121cb convert a helper method to be a static function instead of a
template.  Also convert it to take a MachineOperand instead of a GV*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 05:27:43 +00:00
Bill Wendling
d15f45f53e If -fomit-frame-pointer is used, we still need to record when the %esp register
is modified. Otherwise, the unwinder will get confused. The old code (before I
started my hacking) did this. It dropped on the floor, because I wasn't aware of
this requirement.

On the plus side, if we use "alloca" in a function, we create frame pointers
even with -fomit-frame-pointer is enabled!

This is a Good Thing(tm)!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 22:30:02 +00:00