Evan Cheng
4f87295872
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.
llvm-svn: 75116
2009-07-09 06:53:48 +00:00
Lang Hames
ceb80b14d3
Improved tracking of value number kills. VN kills are now represented
...
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.
A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test
condition has been updated to reflect this.
llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Dan Gohman
01912bc556
Make SelectionDAG::getVectorShuffle work properly for VECTOR_SHUFFLE
...
nodes with operand types that differ from the result type. (This
doesn't normally happen right now, because
SelectionDAGLowering::visitShuffleVector normalizes vector shuffles.)
llvm-svn: 75081
2009-07-09 00:46:33 +00:00
David Goodwin
49fbd8d6b7
Use common code for both ARM and Thumb-2 instruction and register info.
...
llvm-svn: 75067
2009-07-08 23:10:31 +00:00
Duncan Sands
888e420637
Nowadays vectors are only split if they have an even
...
number of elements. Make some simplifications based
on this (in particular SplitVecRes_SETCC). Tighten
up some checking while there.
llvm-svn: 75050
2009-07-08 21:34:03 +00:00
Bill Wendling
8538bf59a8
Use interators instead of counters for loops.
...
llvm-svn: 75046
2009-07-08 20:57:27 +00:00
Owen Anderson
9331034838
Push LLVMContext _back_ through IRBuilder.
...
llvm-svn: 75040
2009-07-08 20:50:47 +00:00
Owen Anderson
332aae685b
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
...
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Duncan Sands
f3d675f3dd
Remove trailing whitespace. Reorder some methods
...
and cases alphabetically. No functionality change.
llvm-svn: 75001
2009-07-08 11:36:39 +00:00
Nick Lewycky
d46a7b2d22
Remove the vicmp and vfcmp instructions. Because we never had a release with
...
these instructions, no autoupgrade or backwards compatibility support is
provided.
llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7a1f69e433
Push LLVMContext through GlobalVariables and IRBuilder.
...
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Chris Lattner
ea7bd9b484
dag combine sext(setcc) -> vsetcc before legalize. To make this safe,
...
VSETCC must define all bits, which is different than it was documented
to before. Since all targets that implement VSETCC already have this
behavior, and we don't optimize based on this, just change the
documentation. We now get nice code for vec_compare.ll
llvm-svn: 74978
2009-07-08 00:31:33 +00:00
Chris Lattner
0e88c6a9b4
SelectionDAG::SignBitIsZero doesn't work right for vectors,
...
for now, conservatively return false.
llvm-svn: 74969
2009-07-07 23:28:46 +00:00
Dale Johannesen
f77b78ed70
Operand of asm("call") (the callee function) is represented
...
as "X" constraint and "P" modifier on x86. Make this work.
(Change may not be sufficient to fix it for non-Darwin, but
I'm pretty sure it won't break anything.)
gcc.apple/asm-block-32.c
gcc.apple/asm-block-33.c
llvm-svn: 74967
2009-07-07 23:26:33 +00:00
Chris Lattner
e2435c4f6f
add support for legalizing an icmp where the result is illegal (4xi1) but
...
the input is legal (4 x i32)
llvm-svn: 74964
2009-07-07 23:03:54 +00:00
Chris Lattner
8604f71f91
random code cleanups.
...
llvm-svn: 74962
2009-07-07 22:49:15 +00:00
Chris Lattner
a754f344b2
implement support for spliting and scalarizing vector setcc's. This
...
finishes off enough support for vector compares to get the icmp/fcmp
version of 2008-07-23-VSetCC.ll passing.
llvm-svn: 74961
2009-07-07 22:47:46 +00:00
Chris Lattner
440ad90c83
lower vector icmp/fcmp to ICMP/FCMP nodes with the right result
...
(vector of bool).
llvm-svn: 74960
2009-07-07 22:41:32 +00:00
Chris Lattner
8361a0c867
ScalarizeVecRes_ShiftOp and ScalarizeVecRes_BinOp are the same,
...
eliminate the former.
llvm-svn: 74959
2009-07-07 22:28:41 +00:00
Chris Lattner
7e1482b246
add support for vector legalizing of *_EXTEND.
...
llvm-svn: 74957
2009-07-07 22:27:17 +00:00
Devang Patel
e416111eeb
Accidently dropped this while removing dead code in previous commit.
...
llvm-svn: 74953
2009-07-07 21:55:14 +00:00
Devang Patel
4fdc3e6c1d
Remove dead code.
...
llvm-svn: 74949
2009-07-07 21:12:32 +00:00
Owen Anderson
75f0f1cc6c
Have scoped mutexes take referenes instead of pointers.
...
llvm-svn: 74931
2009-07-07 18:33:04 +00:00
Evan Cheng
c0a72563c9
Revert 74898. It broke several tests.
...
llvm-svn: 74925
2009-07-07 17:50:43 +00:00
Sanjiv Gupta
83f715997c
if the terminator is a branch depending upon the side effects of a
...
previous cmp; a copy can not be inserted here if the copy insn also has
side effects. We don't have access to the attributes of copy insn here;
so just play safe by finding a safe locations for branch terminators.
llvm-svn: 74898
2009-07-07 08:04:51 +00:00
Evan Cheng
29ce3bfbb8
Avoid adding a duplicate def. This fixes PR4478.
...
llvm-svn: 74857
2009-07-06 21:34:05 +00:00
Duncan Sands
79c4498f99
Fix the cmake build - patch by Xerxes Rånby.
...
llvm-svn: 74825
2009-07-06 14:28:32 +00:00
Bruno Cardoso Lopes
f03970cf37
Changed ELFCodeEmitter to inherit from ObjectCodeEmitter
...
llvm-svn: 74821
2009-07-06 09:26:48 +00:00
Bruno Cardoso Lopes
fe9ea88db1
Cleanup MachO writer and code emitter. Fix 80 cols problems, remove extra spaces, shrink down includes and move some methods out-of-line
...
llvm-svn: 74817
2009-07-06 06:40:51 +00:00
Bruno Cardoso Lopes
c28df0f408
Just forgot to include the two new files
...
llvm-svn: 74814
2009-07-06 05:16:40 +00:00
Bruno Cardoso Lopes
38373542a1
Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
...
cleanup, removed some #includes and moved Object Code Emitter out-of-line.
llvm-svn: 74813
2009-07-06 05:09:34 +00:00
Owen Anderson
977aa11bc6
More LLVMContext-ification.
...
llvm-svn: 74807
2009-07-05 22:41:43 +00:00
Tilmann Scheller
cea3c16aa5
Add NumFixedArgs attribute to CallSDNode which indicates the number of fixed arguments in a vararg call.
...
With the SVR4 ABI on PowerPC, vector arguments for vararg calls are passed differently depending on whether they are a fixed or a variable argument. Variable vector arguments always go into memory, fixed vector arguments are put
into vector registers. If there are no free vector registers available, fixed vector arguments are put on the stack.
The NumFixedArgs attribute allows to decide for an argument in a vararg call whether it belongs to the fixed or variable portion of the parameter list.
llvm-svn: 74764
2009-07-03 06:44:53 +00:00
Bruno Cardoso Lopes
0dc4fd3fcc
Factor some code out and support for Jump Table relocations
...
llvm-svn: 74760
2009-07-03 04:36:26 +00:00
Devang Patel
5f93a737f6
Simplify debug info intrisinc lowering.
...
llvm-svn: 74733
2009-07-02 22:43:26 +00:00
Douglas Gregor
b523a25108
CMake build fixes, from Xerxes Ranby
...
llvm-svn: 74720
2009-07-02 18:53:52 +00:00
Bruno Cardoso Lopes
810ef07890
shrinking down #includes
...
llvm-svn: 74718
2009-07-02 18:29:24 +00:00
Bruno Cardoso Lopes
bd4ae81317
Remove getFunctionAlignment from TargetELFInfo and use new MachineFunction alignment method
...
llvm-svn: 74686
2009-07-02 02:13:13 +00:00
Devang Patel
735f7d53ca
Simplify.
...
llvm-svn: 74677
2009-07-02 00:28:03 +00:00
Devang Patel
2e373cdc9f
Simplify. No intentional functionality change.
...
llvm-svn: 74673
2009-07-02 00:08:09 +00:00
Devang Patel
1fececd8c1
Refactor. No functionality change.
...
llvm-svn: 74659
2009-07-01 23:19:01 +00:00
Devang Patel
9149c185a4
llvm.dbg.declare is always used for local variable's debug info.
...
llvm-svn: 74625
2009-07-01 18:51:07 +00:00
Evan Cheng
e6989735a6
CommuteChangesDestination() should check if to-be-commuted instruction defines any register. Also teaches the default commuteInstruction() to commute instruction without definitions (e.g. X86::test / ARM::tsp).
...
llvm-svn: 74602
2009-07-01 08:29:08 +00:00
Evan Cheng
7d78cb531e
Remove special handling of implicit_def. Fix a couple more bugs in liveintervalanalysis and coalescer handling of implicit_def.
...
Note, isUndef marker must be placed even on implicit_def def operand or else the scavenger will not ignore it. This is necessary because -O0 path does not use liveintervalanalysis, it treats implicit_def just like any other def.
llvm-svn: 74601
2009-07-01 08:19:36 +00:00
Evan Cheng
37503e9671
Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.
...
llvm-svn: 74580
2009-07-01 01:59:31 +00:00
Daniel Dunbar
bc3d149e98
Remove unused AsmPrinter OptLevel argument, and propogate.
...
- This more or less amounts to a revert of r65379. I'm curious to know what
happened that caused this variable to become unused.
llvm-svn: 74579
2009-07-01 01:48:54 +00:00
Bill Wendling
c0fb316bd3
Add an "alignment" field to the MachineFunction object. It makes more sense to
...
have the alignment be calculated up front, and have the back-ends obey whatever
alignment is decided upon.
This allows for future work that would allow for precise no-op placement and the
like.
llvm-svn: 74564
2009-06-30 22:38:32 +00:00
Evan Cheng
28b9e77f19
Temporarily restore the scavenger implicit_def checking code. MachineOperand isUndef mark is not being put on implicit_def of physical registers (created for parameter passing, etc.).
...
llvm-svn: 74519
2009-06-30 09:19:42 +00:00
Evan Cheng
c6c942b70f
Add a bit IsUndef to MachineOperand. This indicates the def / use register operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them.
...
The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing.
This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def.
llvm-svn: 74518
2009-06-30 08:49:04 +00:00
Devang Patel
e35cd91347
Struct types are described using field types only.
...
llvm-svn: 74477
2009-06-29 23:46:50 +00:00
Devang Patel
bff451b95b
s/MainCU/ModuleCU/g
...
llvm-svn: 74452
2009-06-29 20:45:18 +00:00
Devang Patel
4ba8cbff55
Multiple DW_TAG_compile_unit is not used, afaict, on any target.
...
Update dwarf writer to only emit one DW_TAG_compile_unit per .o file.
llvm-svn: 74449
2009-06-29 20:38:13 +00:00
Dan Gohman
e25e17d91e
Eliminate a layer of indirection in LoopInfo and MachineLoopInfo.
...
llvm-svn: 74394
2009-06-27 21:22:48 +00:00
Chris Lattner
0ce83b0e95
When doing remat, don't consider uses of non-allocatable physregs. Patch
...
by Evan.
llvm-svn: 74370
2009-06-27 04:06:41 +00:00
Chris Lattner
ce7f3c052e
fix a typo that GCC should have caught that causes crashes with -view-*-dags
...
llvm-svn: 74364
2009-06-27 00:57:02 +00:00
Chris Lattner
ca9aefcc93
fix a really subtle bug in the cross section of aliases and TLS:
...
the SelectionDAG::getGlobalAddress function properly looks through
aliases to determine thread-localness, but then passes the GV* down
to GlobalAddressSDNode::GlobalAddressSDNode which does not. Instead
of passing down isTarget, just pass down the predetermined node
opcode. This fixes some assertions with out of tree changes I'm
working on.
llvm-svn: 74325
2009-06-26 21:14:05 +00:00
Owen Anderson
0cf6b34d5d
Get rid of these cache variables, which are a holdover from the days when
...
we had multiple type planes and these lookups were expensive.
llvm-svn: 74319
2009-06-26 20:33:47 +00:00
Chris Lattner
0fee902c2d
implement DOTGraphTraits<SelectionDAG*>::getNodeLabel in terms of
...
SDNode::print_details to eliminate a ton of near-duplicate code.
llvm-svn: 74311
2009-06-26 19:06:10 +00:00
Douglas Gregor
6d9b0e8c19
Fix linking of llvm-ld and lli with CMake, from Xerxes Rånby
...
llvm-svn: 74285
2009-06-26 15:37:00 +00:00
Chris Lattner
05eabf4f95
dot graph viewing is apparently not using SDNode::print_details, this is bad,
...
but in the meantime lets print targetflags on node labels.
llvm-svn: 74274
2009-06-26 05:55:43 +00:00
Chris Lattner
3aef0c897e
propagate target operand flags from dag nodes into MachineOperands.
...
llvm-svn: 74273
2009-06-26 05:52:14 +00:00
Chris Lattner
181d139bc3
fit in 80 cols
...
llvm-svn: 74270
2009-06-26 05:39:02 +00:00
Devang Patel
84a8914a4a
Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
...
and llvm.dbg.global_variables.
llvm-svn: 74251
2009-06-26 01:49:18 +00:00
Devang Patel
32bbebe82f
Simplify.
...
llvm-svn: 74215
2009-06-25 22:36:02 +00:00
Chris Lattner
6a77e841e8
add targetflags to jump tables and constant pool entries.
...
llvm-svn: 74204
2009-06-25 21:35:31 +00:00
Chris Lattner
f94959f1a3
allow setting target operand flags on TargetGlobalAddress nodes.
...
llvm-svn: 74203
2009-06-25 21:21:14 +00:00
Chris Lattner
55fdaaf6e7
start bringing targetoperand flags into isel, first up, ExternalSymbol.
...
llvm-svn: 74199
2009-06-25 18:45:50 +00:00
Owen Anderson
76d92148a7
Provide guards for this shared structure. I'm not sure this actually needs
...
to be shared, but how/where to privatize it is not immediately clear to me.
If any SelectionDAG experts see a better solution, please share!
llvm-svn: 74180
2009-06-25 17:09:00 +00:00
Owen Anderson
7bc2987c5c
Privatize some more debug-related static data.
...
llvm-svn: 74179
2009-06-25 16:55:32 +00:00
Bruno Cardoso Lopes
5e0be0b9a1
Support Constant Pool Sections
...
Add section symbols to the symbol table
llvm-svn: 74170
2009-06-25 07:36:24 +00:00
Bill Wendling
edfdb32218
My guess is that RegInfo should only call the Allocator.Deallocator if it's not
...
null.
llvm-svn: 74147
2009-06-25 00:32:48 +00:00
Owen Anderson
696fd9b29e
Now with EVEN FEWER statics!
...
llvm-svn: 74143
2009-06-25 00:04:15 +00:00
Owen Anderson
a21f94d6ba
Fewer static variables, part 3 of many.
...
llvm-svn: 74140
2009-06-24 23:41:44 +00:00
Owen Anderson
e194f62a43
Down with _even more_ statics!
...
llvm-svn: 74137
2009-06-24 23:13:56 +00:00
Owen Anderson
7b32a5b971
Down with statics!
...
llvm-svn: 74134
2009-06-24 22:53:20 +00:00
Owen Anderson
9832095b30
Move local statics to per-instance variables.
...
llvm-svn: 74132
2009-06-24 22:28:12 +00:00
Lang Hames
b9f524d565
Completed basic intra block split implementation.
...
llvm-svn: 74114
2009-06-24 20:46:24 +00:00
David Greene
08b3d807e8
This increases the maximum for MVT::LAST_VALUETYPE
...
This change doubles the allowable value for MVT::LAST_VALUETYPE. It does
this by doing several things.
1. Introduces MVT::MAX_ALLOWED_LAST_VALUETYPE which in this change has a
value of 64. This value contains the current maximum for the
MVT::LAST_VALUETYPE.
2. Instead of checking "MVT::LAST_VALUETYPE <= 32", all of those uses
now become "MVT::LAST_VALUETYPE <= MVT::MAX_ALLOWED_LAST_VALUETYPE"
3. Changes the dimension of the ValueTypeActions from 2 elements to four
elements and adds comments ahead of the declaration indicating the it is
"(MVT::MAX_ALLOWED_LAST_VALUETYPE/32) * 2". This at least lets us find
what is affected if and when MVT::MAX_ALLOWED_LAST_VALUETYPE gets
changed.
4. Adds initializers for the new elements of ValueTypeActions.
This does NOT add any types in MVT. That would be done separately.
This doubles the size of ValueTypeActions from 64 bits to 128 bits and
gives us the freedom to add more types for AVX.
llvm-svn: 74110
2009-06-24 19:41:55 +00:00
Chris Lattner
ee30c14d3b
sink management of DwarfWriter & MachineModuleInfo into the AsmPrinter base class.
...
llvm-svn: 74101
2009-06-24 19:09:55 +00:00
Chris Lattner
d59a5b9f8b
sink dwarf finalization out of each target into AsmPrinter::doFinalization
...
llvm-svn: 74097
2009-06-24 18:54:37 +00:00
Chris Lattner
0690755320
eliminate the ExtWeakSymbols set from AsmPrinter. This eliminates
...
a bunch of code from all the targets, and eliminates nondeterministic
ordering of directives being emitted in the output.
llvm-svn: 74096
2009-06-24 18:52:01 +00:00
Chris Lattner
cabe904f79
Rearrange some stuff in MachineOperand and add a new TargetFlags field.
...
llvm-svn: 74087
2009-06-24 17:54:48 +00:00
Owen Anderson
90f7655f57
Get rid of the global CFGOnly flag by threading a ShortNames parameters through the GraphViz rendering code.
...
Update other uses in the codebase for this change.
llvm-svn: 74084
2009-06-24 17:37:09 +00:00
Dale Johannesen
5bad20bda8
Rewrite 73900 per Duncan's suggestion.
...
llvm-svn: 74082
2009-06-24 17:11:31 +00:00
Chris Lattner
07463b0a0a
remove dead makefile flags.
...
llvm-svn: 74065
2009-06-24 05:29:56 +00:00
Lang Hames
38bf7cf4e2
Fixed a bug in LiveInterval scaling (failure to scale VNI defs correctly), removed old TODO comments.
...
llvm-svn: 74054
2009-06-24 02:17:32 +00:00
Evan Cheng
7292cadf06
Fix support for inline asm input / output operand tying when operand spans across multiple registers (e.g. two i64 operands in 32-bit mode).
...
llvm-svn: 74053
2009-06-24 02:05:51 +00:00
Bruno Cardoso Lopes
bd023b8ebe
Use a default alignment for data and bss sections.
...
Only pad when the section size > 0 and move the code that deals
with globals initializers to a place we know for sure the global
is initialized.
llvm-svn: 73944
2009-06-23 04:39:27 +00:00
Dale Johannesen
e577db0efd
Fix memcpy expansion so it won't generate invalid
...
types for the target (I think). This was breaking
the PPC32 calling sequence.
llvm-svn: 73900
2009-06-22 20:59:07 +00:00
Evan Cheng
2410955c62
Fix another register coalescer crash: forgot to check if the instruction being updated has already been coalesced.
...
llvm-svn: 73898
2009-06-22 20:49:32 +00:00
Bruno Cardoso Lopes
4615b9cdf9
Use different functions to emit the string and symbol tables.
...
llvm-svn: 73895
2009-06-22 19:29:56 +00:00
Bruno Cardoso Lopes
7b196ba30e
Add more methods to gather target specific elf stuff
...
Support for .text relocations, implementing TargetELFWriter overloaded methods for x86/x86_64.
Use a map to track global values to their symbol table indexes
Code cleanup and small fixes
llvm-svn: 73894
2009-06-22 19:16:16 +00:00
Evan Cheng
b45918e5bb
Fix PR4419: handle defs of partial uses.
...
llvm-svn: 73816
2009-06-20 04:34:51 +00:00
Devang Patel
e2b1c9a530
mv CodeGen/DebugLoc.h Support/DebugLoc.h
...
llvm-svn: 73786
2009-06-19 22:08:58 +00:00
Devang Patel
35810cd07b
Move up dwarf writer initialization in common AsmPrinter class.
...
llvm-svn: 73784
2009-06-19 21:54:26 +00:00
Eli Friedman
eb83635a7e
Minor cleanup; fixes review comments for a previous patch. Sorry for
...
taking so long to get to this!
llvm-svn: 73757
2009-06-19 06:01:55 +00:00
Lang Hames
1bade5ff09
More VNInfo tweaking, plus a little progress on intra-block splitting.
...
llvm-svn: 73750
2009-06-19 02:17:53 +00:00
Chris Lattner
6cd267dcc5
move mangler quote handling from asm printers to TargetAsmInfo.
...
llvm-svn: 73738
2009-06-18 23:41:35 +00:00
Chris Lattner
ea0ea2f4bc
simplify macro debug info directive handling.
...
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Lang Hames
7f288c29af
Improved PHI def marking, replaced some gotos with breaks.
...
llvm-svn: 73727
2009-06-18 22:01:47 +00:00