Commit Graph

4585 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes
171375f73a Add support to properly reference private symbols on relocation entries.
Use proper relocation type to build relocations for JumpTables (rodata
sections).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 19:30:09 +00:00
Evan Cheng
5248468473 Enable cross register class coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 02:10:10 +00:00
Evan Cheng
47e9fab158 Fix x86 inline ams 'q' constraint support. In 32-bit mode, it's just like 'Q', i.e. EAX, EDX, ECX, EBX. In 64-bit mode, it just means all the i64r registers. Yeah, that makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 22:13:25 +00:00
Chris Lattner
e2cf37b88c Untangle a snarl that I discovered when updating the mangler,
starting in getCurrentFunctionEHName.  Among other problems,
we would try to privative a "foo.eh" label, but end up emitting
the label as _Lfoo.eh instead of L_foo.eh on darwin.  This is really
bad, and the linker has always tolerated these labels existing.
For now, just emit them as _foo.eh.

This patch also fixes problems with ".eh" labels on unnamed
functions and eliminates two strangely defined TargetAsmInfo
hooks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:46:40 +00:00
Daniel Dunbar
092a9dda2d Sketch support for target specific assembly parser.
- Not fully enabled yet, need a configure regeneration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:42:00 +00:00
Daniel Dunbar
4b9e165904 Start generating AsmMatcher.inc for X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 18:55:26 +00:00
Evan Cheng
a82b22c667 GV with ghost linkage (module being lazily streamed in in JIT lazy compilation mode) do not require extra load from stub. This fixes ExecutionEngine/2005-12-02-TailCallBug.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 22:53:10 +00:00
Jakob Stoklund Olesen
93e55deeba Silence warning in Linux builds:
X86InstrInfo.cpp:2272: warning: suggest explicit braces to avoid ambiguous 'else'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 21:24:13 +00:00
Jeffrey Yasskin
32360a7e21 Add line numbers to OProfile. To do this, I added a processDebugLoc()
call to the MachineCodeEmitter interface and made copying the start
line of a function not conditional on whether we're emitting Dwarf
debug information. I'll propagate the processDebugLoc() calls to the
non-X86 targets in a followup patch.

In the long run, it'll probably be better to gather this information
through the DwarfWriter, but the DwarfWriter currently depends on the
AsmPrinter and TargetAsmInfo, and fixing that would be out of the way
for this patch.

There's a bug in OProfile 0.9.4 that makes it ignore line numbers for
addresses above 4G, and a patch fixing it at
http://thread.gmane.org/gmane.linux.oprofile/7634

Sample output:

$ sudo opcontrol --reset; sudo opcontrol --start-daemon; sudo opcontrol --start; `pwd`/Debug/bin/lli fib.bc; sudo opcontrol --stop
Signalling daemon... done
Profiler running.
fib(40) == 165580141
Stopping profiling.

$ opreport -g -d -l `pwd`/Debug/bin/lli|head -60
Overflow stats not available
CPU: Core 2, speed 1998 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
vma      samples  %        linenr info                 image name               symbol name
00007f67a30370b0 25489    61.2554  fib.c:24                    10946.jo                 fib_left
  00007f67a30370b0 1634      6.4106  fib.c:24
  00007f67a30370b1 83        0.3256  fib.c:24
  00007f67a30370b9 1997      7.8348  fib.c:24
  00007f67a30370c6 2080      8.1604  fib.c:27
  00007f67a30370c8 988       3.8762  fib.c:27
  00007f67a30370cd 1315      5.1591  fib.c:27
  00007f67a30370cf 251       0.9847  fib.c:27
  00007f67a30370d3 1191      4.6726  fib.c:27
  00007f67a30370d6 975       3.8252  fib.c:27
  00007f67a30370db 1010      3.9625  fib.c:27
  00007f67a30370dd 242       0.9494  fib.c:27
  00007f67a30370e1 2782     10.9145  fib.c:28
  00007f67a30370e5 3768     14.7828  fib.c:28
  00007f67a30370eb 615       2.4128  (no location information)
  00007f67a30370f3 6558     25.7287  (no location information)
00007f67a3037100 15603    37.4973  fib.c:29                    10946.jo                 fib_right
  00007f67a3037100 1646     10.5493  fib.c:29
  00007f67a3037101 45        0.2884  fib.c:29
  00007f67a3037109 2372     15.2022  fib.c:29
  00007f67a3037116 2234     14.3178  fib.c:32
  00007f67a3037118 612       3.9223  fib.c:32
  00007f67a303711d 622       3.9864  fib.c:32
  00007f67a303711f 385       2.4675  fib.c:32
  00007f67a3037123 404       2.5892  fib.c:32
  00007f67a3037126 634       4.0633  fib.c:32
  00007f67a303712b 870       5.5759  fib.c:32
  00007f67a303712d 62        0.3974  fib.c:32
  00007f67a3037131 1848     11.8439  fib.c:33
  00007f67a3037135 2840     18.2016  fib.c:33
  00007f67a303713a 1         0.0064  fib.c:33
  00007f67a303713b 1023      6.5564  (no location information)
  00007f67a3037143 5         0.0320  (no location information)
000000000080c1e4 15        0.0360  MachineOperand.h:150        lli                      llvm::MachineOperand::isReg() const
  000000000080c1e4 6        40.0000  MachineOperand.h:150
  000000000080c1ec 2        13.3333  MachineOperand.h:150
...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76102 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 21:07:26 +00:00
Evan Cheng
2b48ab947c With recent MC changes, RIP base register is explicitly modeled. Make sure we add it when x86 V_SET0 / V_SETALLONES (by transforming it into a constpool load) into the use instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 18:44:05 +00:00
Anton Korobeynikov
f366beca48 Do not put bunch of target-specific stuff into common namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 14:03:08 +00:00
Evan Cheng
378445303b Let callers decide the sub-register index on the def operand of rematerialized instructions.
Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 09:20:10 +00:00
Chris Lattner
6ef40b11f8 use SUBREG_TO_REG instead of INSERT_SUBREG, this way the code
generator can know the top bits are zero, not undefined.
Thanks to Dan for pointing this out.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 06:31:37 +00:00
Daniel Dunbar
64cc972123 Kill off <TARGET>MachineModule variables, and <TARGETASMPRINTER>ForceLink
variables.
 - Module initialization functions supplanted the need for these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 01:55:13 +00:00
Daniel Dunbar
5d77cad60b Lift addAssemblyEmitter into LLVMTargetMachine.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 23:34:19 +00:00
Daniel Dunbar
cfe9a605ee Lift DumpAsm / -print-emitted-asm functionality into LLVMTargetMachine.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 22:33:19 +00:00
Daniel Dunbar
f05522974b Remove old style hacks to register AsmPrinter into TargetMachine.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 22:01:32 +00:00
Owen Anderson
a90b3dc2f1 Move a few more convenience factory functions from Constant to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 21:51:10 +00:00
Bruno Cardoso Lopes
4b70fab658 use std::vector instead of std::list for both Section and Symbol lists because
we care more about random access than insertion/deletion of elements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 20:49:10 +00:00
Daniel Dunbar
51b198af83 Reapply TargetRegistry refactoring commits.
--- Reverse-merging r75799 into '.':
 U   test/Analysis/PointerTracking
U    include/llvm/Target/TargetMachineRegistry.h
U    include/llvm/Target/TargetMachine.h
U    include/llvm/Target/TargetRegistry.h
U    include/llvm/Target/TargetSelect.h
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp
U    tools/llc/llc.cpp
U    lib/Target/PowerPC/PPCTargetMachine.h
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/PowerPC/PPCTargetMachine.cpp
U    lib/Target/PowerPC/PPC.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/ARMTargetMachine.h
U    lib/Target/ARM/ARM.h
U    lib/Target/XCore/XCoreTargetMachine.cpp
U    lib/Target/XCore/XCoreTargetMachine.h
U    lib/Target/PIC16/PIC16TargetMachine.cpp
U    lib/Target/PIC16/PIC16TargetMachine.h
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/Alpha/AlphaTargetMachine.cpp
U    lib/Target/Alpha/AlphaTargetMachine.h
U    lib/Target/X86/X86TargetMachine.h
U    lib/Target/X86/X86.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.h
U    lib/Target/CppBackend/CPPTargetMachine.h
U    lib/Target/CppBackend/CPPBackend.cpp
U    lib/Target/CBackend/CTargetMachine.h
U    lib/Target/CBackend/CBackend.cpp
U    lib/Target/TargetMachine.cpp
U    lib/Target/IA64/IA64TargetMachine.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/IA64/IA64TargetMachine.h
U    lib/Target/IA64/IA64.h
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.h
U    lib/Target/CellSPU/SPU.h
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U    lib/Target/Mips/MipsTargetMachine.cpp
U    lib/Target/Mips/MipsTargetMachine.h
U    lib/Target/Mips/Mips.h
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Sparc/SparcTargetMachine.cpp
U    lib/Target/Sparc/SparcTargetMachine.h
U    lib/ExecutionEngine/JIT/TargetSelect.cpp
U    lib/Support/TargetRegistry.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 20:24:03 +00:00
Stuart Hastings
2286f8dc4c Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 17:27:11 +00:00
Daniel Dunbar
f3f4715ac1 Replace large swaths of copy-n-paste code with obvious helper function...
- Which was already present in the module!

 - I skipped this xform for Alpha, since it runs an extra pass during assembly
   emission, but not when emitting assembly via the DumpAsm flag.

 - No functionality change.

--
ddunbar@giles:llvm$ svn diff | grep '^- ' | sort | uniq -c
  18 -      PM.add(AsmPrinterCtor(ferrs(), *this, true));
  18 -    assert(AsmPrinterCtor && "AsmPrinter was not linked in");
  18 -    if (AsmPrinterCtor)
  18 -  if (DumpAsm) {
  18 -  }
ddunbar@giles:llvm$ svn diff | grep '^+ ' | sort | uniq -c
  18 +    addAssemblyEmitter(PM, OptLevel, true, ferrs());
  18 +  if (DumpAsm)
--


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 12:49:15 +00:00
Daniel Dunbar
6c05796294 Kill off old (TargetMachine level, not Target level) match quality functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 12:26:05 +00:00
Daniel Dunbar
03f4bc5d6c Provide TargetMachine implementations with reference to Target they were created
from.
 - This commit is almost entirely propogating the reference through the
   TargetMachine subclasses' constructor calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 12:11:05 +00:00
Daniel Dunbar
4246790aa8 Register Target's TargetMachine and AsmPrinter in the new registry.
- This abuses TargetMachineRegistry's constructor for now, this will get
   cleaned up in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 09:22:31 +00:00
Daniel Dunbar
c984df8602 Add TargetInfo libraries for all targets.
- Intended to match current TargetMachine implementations.

 - No facilities for linking these in yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 06:35:19 +00:00
Evan Cheng
f9b36f08ef Move load / store folding alignment require into the table(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 06:10:07 +00:00
Chris Lattner
c08872ec60 rename decorateName -> DecorateCygMingName, make it assert if not
cygming, make the two callers only call it if cygming.  Other minor
cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 04:55:56 +00:00
Chris Lattner
f813d7d7ef use makeNameProper to add the globalprefix instead of doing it manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 03:01:23 +00:00
Chris Lattner
b7b179ead9 actually $stub labels *are* private, I just missed that
printSuffixedName automatically does this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:53:36 +00:00
Chris Lattner
2e2ad51ffd $stub references should not be private ("L") labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 01:23:13 +00:00
Daniel Dunbar
a89b7ea9d6 Fix path name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 22:58:03 +00:00
Bruno Cardoso Lopes
f6fbad15f7 Use the right relocation type for X86::MOV64ri64i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 21:46:40 +00:00
Chris Lattner
9ac7542bab 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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:19:57 +00:00
David Greene
71847813bc Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 20:18:05 +00:00
Chris Lattner
b8158acc23 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 18:17:16 +00:00
Torok Edwin
c23197a26f 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").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:55:14 +00:00
Daniel Dunbar
192957d376 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:12:13 +00:00
Daniel Dunbar
41ffe6c7af 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 15:57:55 +00:00
Torok Edwin
481d15a122 eliminate extra space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 12:22:58 +00:00
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
Dale Johannesen
39f59d8250 Handle 'A' modifier in inline asms.
gcc.apple/asm-block-13.c
gcc.apple/asm-block-57.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 20:06:27 +00:00
Owen Anderson
d1474d09cb Thread LLVMContext through MVT and related parts of SDISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 17:57:24 +00:00
Eli Friedman
7675040979 Misc encoding fixes; reported on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 16:49:25 +00:00
Chris Lattner
ac007b64ea simplify this logic a bit more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 07:02:30 +00:00
Chris Lattner
75cdf27f48 move reasoning about darwin $non_lazy_ptr stubs from asmprinter into
isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 06:59:17 +00:00
Evan Cheng
910139f9ca Targets sometimes assign fixed stack object to spill certain callee-saved
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as
frame register has to be spilled in the first fixed object. It should inform
PEI this so it doesn't get allocated another stack object. Also, it should not
be spilled as other callee-saved registers but rather its spilling and restoring
are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 06:53:48 +00:00
Chris Lattner
ff7727f4f7 rearrange some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75113 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 06:41:35 +00:00
Chris Lattner
51e8eabd3c make direct calls set MO_PLT or MO_DARWIN_STUB as appropriate with fast isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 06:34:26 +00:00
Chris Lattner
27fde7b2bc reduce nesting by rearranging branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 05:55:04 +00:00
Chris Lattner
4c388b2c9d make isel use MO_PIC_BASE_OFFSET when lowering globalvalues on darwin in pic
mode, instead of having asmprinter just "know" to print them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09 05:47:33 +00:00