Daniel Dunbar
3119e6a609
Switch some clients to Value::getName(), and other getName() user
...
simplification.
- NFC
llvm-svn: 76789
2009-07-22 21:33:09 +00:00
Devang Patel
963b3bc974
Fix indentation.
...
llvm-svn: 76787
2009-07-22 21:10:50 +00:00
Daniel Dunbar
0ff394b13d
Simplify some uses of Value::getName()
...
llvm-svn: 76786
2009-07-22 21:10:12 +00:00
Daniel Dunbar
51818313fe
Remove unnecessary store to temporary std::string.
...
llvm-svn: 76782
2009-07-22 20:46:46 +00:00
David Greene
76d89c51ce
Put comment printing under asm-verbose.
...
llvm-svn: 76780
2009-07-22 20:33:26 +00:00
Daniel Dunbar
b6a40026a7
Fix indentation.
...
llvm-svn: 76778
2009-07-22 20:26:37 +00:00
David Greene
7f92a15a4b
Make some changes suggested by Bill and Evan.
...
llvm-svn: 76775
2009-07-22 20:08:25 +00:00
Devang Patel
7b31d8224d
Fix thinko.
...
llvm-svn: 76769
2009-07-22 18:56:16 +00:00
Devang Patel
04a1939c08
Use isa<> instead of dyn_cast<>.
...
llvm-svn: 76767
2009-07-22 18:35:25 +00:00
Devang Patel
a047636be2
Add replaceAllUsesWith() to FE replace debug info constructs while building complex types.
...
llvm-svn: 76765
2009-07-22 18:23:44 +00:00
Devang Patel
5456f0ba29
Do not print "metadata" twice while printing MDString.
...
This fixes unittest failure.
llvm-svn: 76764
2009-07-22 18:10:23 +00:00
Evan Cheng
ae91b0616b
Eliminate a redudant check Eli pointed out.
...
llvm-svn: 76762
2009-07-22 18:08:05 +00:00
Sanjiv Gupta
2168098478
Fixed build warning. No functionality change.
...
llvm-svn: 76761
2009-07-22 17:58:47 +00:00
Devang Patel
5794cb80ad
Introduce MetadataBase, a base class for MDString and MDNode.
...
Derive MDString directly from MetadataBase.
Introduce new bitcode block to hold metadata.
llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Chris Lattner
573e2cde50
doxygenify
...
llvm-svn: 76750
2009-07-22 16:53:56 +00:00
Duncan Sands
16fd5fb3e8
Add newline at end of file.
...
llvm-svn: 76736
2009-07-22 13:20:41 +00:00
Richard Osborne
7f495fd2bd
Thread local globals don't require special handling by the linker and so can
...
be placed in the standard data / bss sections.
llvm-svn: 76735
2009-07-22 11:01:00 +00:00
Duncan Sands
2a4535353f
Revert commit 76707, it was breaking the llvm-gcc build
...
on linux platforms. The binutils assembler does not
recognize the "s" flag, see for example
http://sourceware.org/binutils/docs/as/Section.html
llvm-svn: 76733
2009-07-22 10:35:05 +00:00
Eli Friedman
ca2e01b721
Don't give a massive inlining cost bonus to available_externally
...
functions with a single use; eliminating the single use may eliminate
the function from the current module, but usually doesn't eliminate
it from the final program.
llvm-svn: 76730
2009-07-22 08:12:59 +00:00
Evan Cheng
34576850e1
Don't forget D16 - D31 are clobbered by calls and sjlj eh.
...
llvm-svn: 76729
2009-07-22 06:46:53 +00:00
Evan Cheng
4fdb43a89d
Add R12 to the list of registers clobbered by 16-bit Thumb calls as a pre-caution. r12 could be live once we have mixed 32-bit and 16-bit instructions.
...
llvm-svn: 76728
2009-07-22 06:37:28 +00:00
Evan Cheng
2e2a1cbab7
Fix a obvious copy-n-paste bug.
...
llvm-svn: 76727
2009-07-22 06:12:40 +00:00
Evan Cheng
005330f8a0
Get rid one of the getRegisterNumbering. Also add D16 - D31.
...
llvm-svn: 76725
2009-07-22 05:55:18 +00:00
Eli Friedman
2b4857cdff
Add support for MMX VSETCC.
...
llvm-svn: 76713
2009-07-22 01:06:52 +00:00
Sean Callanan
1e9eb16a45
Added the unconditional JMP with an 8-bit relocation for the
...
assembler / disassembler.
llvm-svn: 76712
2009-07-22 01:05:20 +00:00
Evan Cheng
f0af946ac8
Add an entry.
...
llvm-svn: 76711
2009-07-22 00:58:27 +00:00
Chris Lattner
2ef030ec2e
inline the two MergeableConstSection implementations into their
...
only caller.
llvm-svn: 76710
2009-07-22 00:47:11 +00:00
Chris Lattner
ced616dd50
set the ELF "small" flag on objects that end up in .rodata.cst4 consistently,
...
updating a mips testcase to expect it.
llvm-svn: 76707
2009-07-22 00:41:56 +00:00
Chris Lattner
d966e55a42
don't set the small flag yet.
...
llvm-svn: 76706
2009-07-22 00:30:39 +00:00
Chris Lattner
e2bd5bc939
remove the SelectSectionForMachineConst hook, replacing it with
...
a new getSectionForMergableConstant hook. This removes one dependence
of TAI on Type, and provides the hook with enough info to make the
right decision based on whether the global has relocations etc.
llvm-svn: 76705
2009-07-22 00:28:43 +00:00
Evan Cheng
82499c09ff
Let each target determines whether a machine instruction is dead. If true, that allows late codeine passes to delete it.
...
This is considered a workaround. The problem is some targets are not modeling side effects correctly. PPC is apparently one of those. This patch allows ppc llvm-gcc to bootstrap on Darwin. Once we find out which instruction definitions are wrong, we can remove the PPCInstrInfo workaround.
llvm-svn: 76703
2009-07-22 00:25:27 +00:00
Owen Anderson
cc287b28c9
Get rid of the Pass+Context magic.
...
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Chris Lattner
48dffde0d7
reimplement Constant::ContainsRelocations as
...
Constant::getRelocationInfo(), which has a much simpler
to use API. It still should not be part of libvmcore, but
is better than it was. Also teach it to be smart about
hidden visibility.
llvm-svn: 76700
2009-07-22 00:05:44 +00:00
Evan Cheng
b639684766
Fixing cp island pass. Step 1: Determine whether the constant pool offset can be
...
negative on an individual bases rather than basing on whether it's in thumb
mode.
llvm-svn: 76698
2009-07-21 23:56:01 +00:00
Evan Cheng
149b0d4cf1
Fix comment.
...
llvm-svn: 76693
2009-07-21 23:54:22 +00:00
Chris Lattner
4d3b78e0f5
simplify code now that it is inlined.
...
llvm-svn: 76689
2009-07-21 23:49:55 +00:00
Lang Hames
0e61f87ea3
Exposed PHIElimination pass within CodeGen.
...
llvm-svn: 76688
2009-07-21 23:47:33 +00:00
Chris Lattner
b9332126cc
Now that RelocBehaviour() is never overloaded, it doesn't need to be
...
virtual. Just inline it into its two current call sites in preparation
for simplifying the code.
llvm-svn: 76686
2009-07-21 23:47:11 +00:00
Chris Lattner
c1c5dab4c4
this doesn't break any of the 4 ia64 tests.
...
llvm-svn: 76683
2009-07-21 23:42:24 +00:00
Chris Lattner
5c144a5948
alpha doesn't need to redefine this: it only supports PIC codegen anyway.
...
llvm-svn: 76682
2009-07-21 23:41:35 +00:00
David Greene
ddaf106a0c
Add some support for iterative coalescers to calculate a joined live
...
range's weight properly. This is turned off right now in the sense that
you'll get an assert if you get into a situation that can only be caused
by an iterative coalescer. All other code paths operate exactly as
before so there is no functional change with this patch. The asserts
should be disabled if/when an iterative coalescer gets added to trunk.
llvm-svn: 76680
2009-07-21 23:36:14 +00:00
Chris Lattner
fb908d7671
no really, I can spell!
...
llvm-svn: 76679
2009-07-21 23:36:01 +00:00
Chris Lattner
11b49ed2ce
add an API so target-independent codegen can determine if a constant
...
pool entry will require relocations against it. I implemented this
conservatively for ARM, someone who is knowledgable about it should
see if this can be improved.
llvm-svn: 76678
2009-07-21 23:34:23 +00:00
Dan Gohman
b45091f0f9
Convert instcombine from using using getAnalysis<TargetData> to
...
getAnalysisIfAvailable<TargetData>.
llvm-svn: 76676
2009-07-21 23:21:54 +00:00
Dan Gohman
8577dd4cca
Permit the IntPtrTy argument to isEliminableCastPair to be null,
...
to help support use when TargetData is not available.
llvm-svn: 76675
2009-07-21 23:19:40 +00:00
Bruno Cardoso Lopes
3483574772
Change ELFCodeEmitter logic to emit the constant pool and jump tables to
...
their appropriate sections before the code itself. They need to be emitted
before the function because on some targets (x86 but not x86_64) the later
may reference a JT or CP entry address
llvm-svn: 76672
2009-07-21 23:13:26 +00:00
Dan Gohman
190d29cb5c
Replace the original ad-hoc code for determining whether (v pred w) implies
...
(x pred y) with more thorough code that does more complete canonicalization
before resorting to range checks. This helps it find more cases where
the canonicalized expressions match.
llvm-svn: 76671
2009-07-21 23:03:19 +00:00
Chris Lattner
fb3e6ae8b2
remove the last bits of SectionFlagsForGlobal. There is some flag here that
...
depends on XS1A, but I think the ReadOnlySection is already set up for this
and there is no testcase that this breaks. If this is really needed, we can
add the appropriate parameterization to TargetAsmInfo in the future to support
this.
llvm-svn: 76667
2009-07-21 22:42:37 +00:00
Chris Lattner
bca235c1d3
don't mask out the small flag and then reapply it later.
...
llvm-svn: 76666
2009-07-21 22:39:28 +00:00
Chris Lattner
34ba5422cd
if Xcore doesn't support TLS, it doesn't have to worry about thread local LLVM IR, it should be rejected by a front-end.
...
llvm-svn: 76665
2009-07-21 22:37:38 +00:00
Chris Lattner
aa793632ff
remove the Xcore implementation of SelectSectionForGlobal. While you have
...
to twist your brain to see it, I believe it is the same as ELFTargetAsmInfo::SelectSectionForGlobal.
llvm-svn: 76664
2009-07-21 22:36:53 +00:00
Chris Lattner
8a24ab398f
simplify based on the fact that darwin always uses L/l.
...
llvm-svn: 76662
2009-07-21 22:32:55 +00:00
Chris Lattner
b52c8153f3
make some stuff private.
...
llvm-svn: 76661
2009-07-21 22:30:39 +00:00
Chris Lattner
0a3a6f2ceb
Remove the XCore custom implementation of MergeableConstSection, relying on
...
the generic ELF version instead. This will result in its mergable constant
sections getting named ".rodata.cst4" instead of ".cp.const4", but the
linker looks at the section flags, not the name of the section AFAICT.
llvm-svn: 76659
2009-07-21 22:25:52 +00:00
Chris Lattner
8d061f011b
inline a trivial method into its only call site and fix indentation of cases
...
llvm-svn: 76654
2009-07-21 21:29:08 +00:00
Chris Lattner
4815d4919c
Remove some overridden functions in XCoreTargetAsmInfo that are
...
implemented exactly the same way as its ELFTargetAsmInfo subclass
has them.
llvm-svn: 76653
2009-07-21 21:26:32 +00:00
Chris Lattner
135caf1a2b
revert r76602, 76603, and r76615, pending design discussions.
...
llvm-svn: 76646
2009-07-21 21:12:58 +00:00
Chris Lattner
589a37a068
minor cleanups.
...
llvm-svn: 76645
2009-07-21 21:09:35 +00:00
Owen Anderson
a8637e9824
Privatize the ConstantArray table.
...
llvm-svn: 76639
2009-07-21 20:55:28 +00:00
Eli Friedman
a78b44069b
Missed a piece of the commit to remove the shift flavor.
...
llvm-svn: 76635
2009-07-21 20:15:24 +00:00
Owen Anderson
bdcb99324a
Privatize the first of the value maps.
...
llvm-svn: 76634
2009-07-21 20:13:12 +00:00
Eli Friedman
45160af6bd
Remove shift amount flavor. It isn't actually complete enough to
...
be useful, and it's currently unused. (Some issues: it isn't actually
rich enough to capture the semantics on many architectures, and
semantics can vary depending on the type being shifted.)
llvm-svn: 76633
2009-07-21 20:12:16 +00:00
Eli Friedman
a62553ec99
Remove a couple of already-implemented notes.
...
llvm-svn: 76631
2009-07-21 20:05:43 +00:00
David Greene
94bfedaf40
Prefix IR dumps with LiveInterval indices when possible. This turns
...
this:
%ESI<def> = MOV32rr %EDI<kill>
ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
%reg1027<def> = MOVZX64rr32 %ESI
%reg1027<def> = ADD64ri8 %reg1027, 15, %EFLAGS<imp-def,dead>
%reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
%RDI<def> = MOV64rr %RSP
%RDI<def> = SUB64rr %RDI, %reg1027<kill>, %EFLAGS<imp-def,dead>
%RSP<def> = MOV64rr %RDI
into this:
4 %reg1024<def> = MOV32rr %EDI<kill>
12 ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
20 %reg1025<def> = MOVZX64rr32 %reg1024
28 %reg1026<def> = MOV64rr %reg1025<kill>
36 %reg1026<def> = ADD64ri8 %reg1026, 15, %EFLAGS<imp-def,dead>
44 %reg1027<def> = MOV64rr %reg1026<kill>
52 %reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
60 %reg1028<def> = MOV64rr %RSP
68 %reg1029<def> = MOV64rr %reg1028<kill>
76 %reg1029<def> = SUB64rr %reg1029, %reg1027<kill>, %EFLAGS<imp-def,dead>
84 %RSP<def> = MOV64rr %reg1029
This helps greatly when debugging register allocation and coalescing
problems.
llvm-svn: 76615
2009-07-21 18:56:32 +00:00
Evan Cheng
66f1d7a0e1
Add fake v7 itineraries for now.
...
llvm-svn: 76612
2009-07-21 18:54:14 +00:00
Chris Lattner
3d4ab7a231
make AsmPrinter::doFinalization iterate over the global variables
...
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.
llvm-svn: 76604
2009-07-21 18:38:57 +00:00
David Greene
979d7aa03a
Add PrefixPrinter arguments to the dump routines for MachineFunction and
...
MachineBasicBlock. We'll use these shortly.
llvm-svn: 76603
2009-07-21 18:27:05 +00:00
Evan Cheng
192fc19379
Do not select tSXTB / tSXTH in thumb2 mode.
...
llvm-svn: 76600
2009-07-21 18:15:26 +00:00
Owen Anderson
7f61f8dc30
Rename getConstantInt{True|False} to get{True|False} at Chris' behest.
...
llvm-svn: 76598
2009-07-21 18:03:38 +00:00
Chris Lattner
89785b23b8
reduce indentation by using an early exit.
...
llvm-svn: 76596
2009-07-21 17:59:36 +00:00
Ted Kremenek
60d0ab4838
Update CMake files.
...
llvm-svn: 76595
2009-07-21 17:43:20 +00:00
Chris Lattner
ac0f5e081e
whitespace cleanups, make the MipsAsmPrinter::doInitialization
...
chain to the super class instead of initializing mangler directly.
This gives it .file and module level inline asm support among other
things.
llvm-svn: 76593
2009-07-21 17:39:48 +00:00
Chris Lattner
433fbf959a
fix Sparc, SystemZ, and MSP430 to not override AsmPrinter::doInitialization.
...
This eliminates redundancy setting up the mangler and adds support to them
for module-level inline asm and a .file directive.
llvm-svn: 76592
2009-07-21 17:37:35 +00:00
Chris Lattner
0f65fbf095
Rename LessPrivateGlobalPrefix -> LinkerPrivateGlobalPrefix to match the
...
LLVM IR concept.
llvm-svn: 76590
2009-07-21 17:30:51 +00:00
Chris Lattner
61fcb8d26b
fix indentation
...
llvm-svn: 76587
2009-07-21 17:25:13 +00:00
Chris Lattner
31a9d57bb9
remove an unneeded override.
...
llvm-svn: 76586
2009-07-21 17:23:41 +00:00
Chris Lattner
2c8fed2c75
more random whitespace cleanup, eliminate #define, avoid copying
...
vectors needlessly, doxygenify comments, improve constness, etc.
llvm-svn: 76585
2009-07-21 17:20:18 +00:00
Chris Lattner
99a474f026
some simple whitespace cleanup, avoid copying vectors for no reason
...
as much, etc.
llvm-svn: 76578
2009-07-21 16:44:47 +00:00
Evan Cheng
c142755cec
Another rewriter bug exposed by recent coalescer changes. ReuseInfo::GetRegForReload() should make sure the "switched" register is in the desired register class. I'm surprised this hasn't caused more failures in the past.
...
llvm-svn: 76558
2009-07-21 09:15:00 +00:00
Daniel Dunbar
3447c5ce67
Add missing include.
...
llvm-svn: 76555
2009-07-21 08:58:44 +00:00
Daniel Dunbar
6f594a00b0
Switch this API to StringRef.
...
llvm-svn: 76554
2009-07-21 08:57:31 +00:00
Daniel Dunbar
a0a76c174b
Simplify / normalize some uses of Value::getName.
...
llvm-svn: 76553
2009-07-21 08:54:24 +00:00
Daniel Dunbar
1edc7a0eab
Remove some unused code.
...
llvm-svn: 76541
2009-07-21 07:08:59 +00:00
Bruno Cardoso Lopes
2015382398
Support adding relocations for data sections, handling the cases where
...
global declared symbols are initialized with references from other global
symbols.
llvm-svn: 76540
2009-07-21 06:51:32 +00:00
Evan Cheng
d76397061a
Add jumps with 8-bit relocation for assembler / disassembler. Patch by Sean Callanan.
...
llvm-svn: 76536
2009-07-21 06:00:18 +00:00
Evan Cheng
0cf19155ef
Fix a dagga combiner bug: avoid creating illegal constant.
...
Is this really a winning transformation?
fold (shl (srl x, c1), c2) -> (shl (and x, (shl -1, c1)), (sub c2, c1)) or
(srl (and x, (shl -1, c1)), (sub c1, c2))
llvm-svn: 76535
2009-07-21 05:40:15 +00:00
Owen Anderson
b64eef73cf
Move a bit more state over to the LLVMContext.
...
llvm-svn: 76533
2009-07-21 02:47:59 +00:00
Bill Wendling
50e5f4884a
Add the following functions:
...
- SYSCALL (normal fast system call instruction) [0f 05]
- SYSENTER (system call entry instruction) [0f 34]
- SYSEXIT (system call exit instruction) [0f 35]
- SYSEXIT64 (system call exit instruction to 64-bit user code) [REX.W 0f 35]
- SYSRET (system call return instruction) [0f 07]
Patch by Sean Callanan.
llvm-svn: 76528
2009-07-21 01:07:24 +00:00
Dan Gohman
00fa00fec8
Make the range calculations for addrecs to be more conservative,
...
as they aren't currently prepared to handle complicated overflow
cases.
llvm-svn: 76524
2009-07-21 00:42:47 +00:00
Dan Gohman
4100aea6ad
Whitespace cleanups.
...
llvm-svn: 76523
2009-07-21 00:38:55 +00:00
Dan Gohman
a37a433693
Minor code simplification.
...
llvm-svn: 76521
2009-07-21 00:37:45 +00:00
Evan Cheng
949c2404a2
Fix ARM isle code that optimize multiply by constants which are power-of-2 +/- 1.
...
llvm-svn: 76520
2009-07-21 00:31:12 +00:00
Evan Cheng
443ae1d494
Cross RC coalescing is now on by default.
...
llvm-svn: 76519
2009-07-21 00:22:59 +00:00
Dale Johannesen
8b0ece80d9
revert 76503 while I figure out what's going on
...
llvm-svn: 76517
2009-07-21 00:12:29 +00:00
Dan Gohman
47100f32c0
Add a comment to clarify why there isn't any code in this spot.
...
llvm-svn: 76505
2009-07-20 23:54:43 +00:00
Dan Gohman
857ccb8149
Remove the code that tried to evaluate whether (A pred B) is known
...
by determining if (B pred (B-A)) is known, as it doesn't handle
overflow correctly.
llvm-svn: 76504
2009-07-20 23:53:35 +00:00
Dale Johannesen
ee3f2d6dc3
Make sure a global matching asm 'i' constraint gets its
...
flags set properly. (hasMemory is clearly irrelevant
when matching 'i', I don't understand what this was
supposed to be doing.)
gcc.apple/asm-block-25.c (test passed before by
accident, but generated code was wrong)
llvm-svn: 76503
2009-07-20 23:39:13 +00:00
Dale Johannesen
04c5ef4742
Move stripping of bitcasts in inline asm arguments
...
to a place where it affects everything. Occurs
only on calls AFAIK.
llvm-svn: 76502
2009-07-20 23:27:39 +00:00
Dan Gohman
b92b14f20b
Minor code simplification.
...
llvm-svn: 76496
2009-07-20 22:41:51 +00:00
Dan Gohman
74a435e9f1
The upper argument of ConstantRange is exclusive, not inclusive.
...
llvm-svn: 76492
2009-07-20 22:34:18 +00:00