Duncan Sands
26ef2a1767
Move getX86RegNum into X86RegisterInfo and use it
...
in the trampoline lowering. Lookup the jump and
mov opcodes for the trampoline rather than hard
coding them.
llvm-svn: 41577
2007-08-29 19:01:20 +00:00
Chris Lattner
c3b406a619
update these
...
llvm-svn: 41565
2007-08-29 16:15:23 +00:00
Dan Gohman
cbb2ee9062
Add an option, -view-sunit-dags, for viewing the actual SUnit DAGs used by
...
scheduling.
llvm-svn: 41556
2007-08-28 20:32:58 +00:00
Evan Cheng
1f3724ee2d
Recover most of the compile time regression due to recent live interval changes.
...
1. Eliminate the costly live interval "swapping".
2. Change ValueNumberInfo container from SmallVector to std::vector. The former
performs slowly when the vector size is very large.
llvm-svn: 41536
2007-08-28 08:28:51 +00:00
Bruno Cardoso Lopes
ff764398e6
Added method to get Mips register numbers
...
Changed the stack frame layout, StackGrowsUp fits better to Mips strange stack.
Stack offset calculation bug fixed!
llvm-svn: 41529
2007-08-28 05:13:42 +00:00
Bruno Cardoso Lopes
144486ca7e
Changed stack allocation On LowerFORMAL_ARGUMENTS.
...
Added comments about new stack allocation.
Expand SelectCC for i32 results
llvm-svn: 41527
2007-08-28 05:08:16 +00:00
Bruno Cardoso Lopes
96894b2c93
Mask directive completed with CalleeSave info
...
Comments for Mips directives added.
llvm-svn: 41526
2007-08-28 05:06:17 +00:00
Bruno Cardoso Lopes
b77d5cd9d5
Added methods to record SPOffsets from LowerFORMAL_ARGUMENTS
...
llvm-svn: 41525
2007-08-28 05:04:41 +00:00
Chris Lattner
73aa3d62dc
Cut off crazy computation. This helps PR1622 slightly.
...
llvm-svn: 41522
2007-08-28 04:23:55 +00:00
Devang Patel
c649f24384
Use simpler test to filter loops.
...
llvm-svn: 41516
2007-08-27 21:34:31 +00:00
David Greene
5b85021be8
Update InvokeInst to work like CallInst
...
llvm-svn: 41506
2007-08-27 19:04:21 +00:00
Rafael Espindola
dc5450f7fb
Add a comment about using libc memset/memcpy or generating inline code.
...
llvm-svn: 41502
2007-08-27 17:48:26 +00:00
Dan Gohman
123b8effaa
Make DAGCombiner's global alias analysis query more precise in the case
...
where both pointers have non-zero offsets.
llvm-svn: 41491
2007-08-27 16:32:11 +00:00
Dan Gohman
2e7e251f24
If the source and destination pointers in an llvm.memmove are known
...
to not alias each other, it can be translated as an llvm.memcpy.
llvm-svn: 41489
2007-08-27 16:26:13 +00:00
Dan Gohman
0b3fc43d5e
Change comments to refer to @malloc and @free instead of %malloc and %free.
...
llvm-svn: 41488
2007-08-27 16:11:48 +00:00
Duncan Sands
883740b39f
There is an impedance matching problem between LLVM and
...
gcc exception handling: if an exception unwinds through
an invoke, then execution must branch to the invoke's
unwind target. We previously tried to enforce this by
appending a cleanup action to every selector, however
this does not always work correctly due to an optimization
in the C++ unwinding runtime: if only cleanups would be
run while unwinding an exception, then the program just
terminates without actually executing the cleanups, as
invoke semantics would require. I was hoping this
wouldn't be a problem, but in fact it turns out to be the
cause of all the remaining failures in the LLVM testsuite
(these also fail with -enable-correct-eh-support, so turning
on -enable-eh didn't make things worse!). Instead we need
to append a full-blown catch-all to the end of each
selector. The correct way of doing this depends on the
personality function, i.e. it is language dependent, so
can only be done by gcc. Thus this patch which generalizes
the eh.selector intrinsic so that it can handle all possible
kinds of action table entries (before it didn't accomodate
cleanups): now 0 indicates a cleanup, and filters have to be
specified using the number of type infos plus one rather than
the number of type infos. Related gcc patches will cause
Ada to pass a cleanup (0) to force the selector to always
fire, while C++ will use a C++ catch-all (null).
llvm-svn: 41484
2007-08-27 15:47:50 +00:00
Dan Gohman
e2c92effea
Add explicit keywords and remove spurious trailing semicolons.
...
llvm-svn: 41482
2007-08-27 14:50:10 +00:00
Rafael Espindola
3d52fe3ef3
call libc memcpy/memset if array size is bigger then threshold.
...
Coping 100MB array (after a warmup) shows that glibc 2.6.1 implementation on
x86-64 (core 2) is 30% faster (from 0.270917s to 0.188079s)
llvm-svn: 41479
2007-08-27 10:18:20 +00:00
Anton Korobeynikov
3dffac0c59
Don't promote volatile loads/stores. This is needed (for example) to handle setjmp/longjmp properly.
...
This fixes PR1520.
llvm-svn: 41461
2007-08-26 21:43:30 +00:00
Owen Anderson
f660f11ec4
Don't DSe volatile stores.
...
llvm-svn: 41456
2007-08-26 21:14:47 +00:00
Dale Johannesen
2ceade197b
Revise per review comments.
...
llvm-svn: 41409
2007-08-26 01:18:27 +00:00
Dale Johannesen
b52093236e
Add APFloat interface to ConstantFPSDNode. Change
...
over uses in DAGCombiner. Fix interfaces to work
with APFloats.
llvm-svn: 41407
2007-08-25 22:10:57 +00:00
Devang Patel
cbfa564c1c
Move exit condition and exit branch from exiting block into loop header and dominator info. This avoid execution of dead iteration. Loop is already filter in the beginning such that this change is safe.
...
llvm-svn: 41394
2007-08-25 02:39:24 +00:00
Devang Patel
d961a55c5a
Constant split values needs upper bound and lower bound check, just like any other split value.
...
llvm-svn: 41389
2007-08-25 01:09:14 +00:00
Chris Lattner
093144e147
Allow target constants to be illegal types. The target should
...
know how to handle them. This fixes
test/CodeGen/Generic/asm-large-immediate.ll
llvm-svn: 41388
2007-08-25 01:00:22 +00:00
Devang Patel
027410a7aa
While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
...
llvm-svn: 41387
2007-08-25 00:56:38 +00:00
Chris Lattner
666f15ac0a
Teach the dag scheduler to handle inline asm nodes with multi-value immediate operands.
...
llvm-svn: 41386
2007-08-25 00:53:07 +00:00
Bill Wendling
da2e7749bb
The personality function might need to be declared as:
...
.set Lset0,___gxx_personality_v0-.
.long Lset0
on some targets. Make it so!
llvm-svn: 41385
2007-08-25 00:51:55 +00:00
Chris Lattner
1e089aac3a
rename isOperandValidForConstraint to LowerAsmOperandForConstraint,
...
changing the interface to allow for future changes.
llvm-svn: 41384
2007-08-25 00:47:38 +00:00
Dale Johannesen
9ec1e28e79
Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.
...
This means backing out the preceding change to Constants.cpp, alas.
llvm-svn: 41378
2007-08-24 22:09:56 +00:00
Dale Johannesen
5c0b0ec1d6
Use APFloat internally for ConstantFPSDNode.
...
llvm-svn: 41372
2007-08-24 20:59:15 +00:00
Chris Lattner
af91aa2f5e
sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
...
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.
llvm-svn: 41371
2007-08-24 20:48:18 +00:00
Devang Patel
c46dc61548
Fix regression that I caused yesterday night while adding logic to select appropriate split condition branch.
...
llvm-svn: 41365
2007-08-24 19:32:26 +00:00
Chris Lattner
d361c3e1ce
Disable EH generation until PPC works 100%.
...
llvm-svn: 41360
2007-08-24 16:00:15 +00:00
Chris Lattner
4c84c39666
add a note
...
llvm-svn: 41359
2007-08-24 15:17:59 +00:00
Devang Patel
0b351a64db
It is not safe to execute split condition's true branch first all the time. If split
...
condition predicate is GT or GE then execute false branch first.
llvm-svn: 41358
2007-08-24 06:17:19 +00:00
Devang Patel
59af13f0cf
Reject ICMP_NE as index split condition.
...
llvm-svn: 41357
2007-08-24 06:02:25 +00:00
Devang Patel
4b52632179
Tightenup loop filter.
...
llvm-svn: 41356
2007-08-24 05:36:56 +00:00
Devang Patel
8b1d0a1ad2
Remove incomplete cost analysis.
...
llvm-svn: 41354
2007-08-24 05:21:13 +00:00
Dale Johannesen
0aaabb858b
Revised per review feedback from previous patch.
...
llvm-svn: 41353
2007-08-24 05:08:11 +00:00
Chris Lattner
91df26be0f
silence some warnings in an optimized build.
...
llvm-svn: 41352
2007-08-24 03:02:34 +00:00
Dale Johannesen
a3ab055b9d
Change internal representation of ConstantFP to use APFloat.
...
Interface to rest of the compiler unchanged, as yet.
llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Chris Lattner
9b22d7527c
add some notes on really poor codegen.
...
llvm-svn: 41319
2007-08-23 15:22:07 +00:00
Chris Lattner
0c048bb115
new example
...
llvm-svn: 41318
2007-08-23 15:16:03 +00:00
Anton Korobeynikov
9451c871c5
Perform correct codegen for eh_dwarf_cfa intrinsic.
...
llvm-svn: 41316
2007-08-23 07:21:06 +00:00
Chris Lattner
742b745b0c
rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
...
Add an APSInt::toString() method.
llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Devang Patel
4ad7c57729
Remove dead code.
...
llvm-svn: 41295
2007-08-22 21:07:41 +00:00
Devang Patel
798ba45c39
Fix typo.
...
llvm-svn: 41292
2007-08-22 20:55:18 +00:00
Devang Patel
59b8967a74
Cosmetic change
...
"True Loop" and "False Loop" naming terminology to refer two loops
after loop cloning is confusing. Instead just use A_Loop and B_Loop.
llvm-svn: 41287
2007-08-22 19:33:29 +00:00
Andrew Lenharth
3902197dc3
move this check. ppc outputs .no_dead_strip properly
...
llvm-svn: 41286
2007-08-22 19:33:11 +00:00
Bill Wendling
dd451b602a
Add the PCSymbol for Darwin x86 platforms.
...
llvm-svn: 41284
2007-08-22 18:44:05 +00:00
Devang Patel
797fbef078
Refactor loop condition check in a separate function.
...
llvm-svn: 41282
2007-08-22 18:27:01 +00:00
Devang Patel
7e6f9f4779
Fix thinko.
...
Starting value of second loop's induction variable can not be lower
then starting value of original loop's induction variable.
llvm-svn: 41280
2007-08-22 18:07:47 +00:00
Devang Patel
60f5256cd1
Rename bunch of variables.
...
llvm-svn: 41250
2007-08-21 21:12:02 +00:00
Devang Patel
4fe5509c7d
Preserve LCSSA.
...
llvm-svn: 41246
2007-08-21 19:47:46 +00:00
Devang Patel
b86f1fdb3f
Use SmallVector.
...
llvm-svn: 41230
2007-08-21 16:54:51 +00:00
Devang Patel
e92ff0baef
No need to hardcode SmallVector size.
...
llvm-svn: 41228
2007-08-21 16:39:43 +00:00
Bruno Cardoso Lopes
14e39d7bcf
InlineAsm asm support for integer registers added
...
llvm-svn: 41225
2007-08-21 16:09:25 +00:00
Bruno Cardoso Lopes
4173f973e9
Instruction Itinerary attribution fixed
...
llvm-svn: 41224
2007-08-21 16:06:45 +00:00
Chris Lattner
8e296cc9d9
Fix potentially N^2 behavior handling arrays with many of the
...
same value which get RAUW'd. This speeds up reading the .bc
file in PR1616 from 852s to 0.19s on my G5 with a debug build.
llvm-svn: 41209
2007-08-21 00:55:23 +00:00
Anton Korobeynikov
f942eb0c45
Use only 1 knob to enable exceptions on Darwin :).
...
llvm-svn: 41208
2007-08-21 00:31:30 +00:00
Devang Patel
f06e667e9c
Use SmallVector instead of std::vector.
...
llvm-svn: 41207
2007-08-21 00:31:24 +00:00
Chris Lattner
07ac73b539
simplify code, improve a comment.
...
llvm-svn: 41205
2007-08-21 00:21:07 +00:00
Devang Patel
b64f73f8f0
s/ExitBlock/ExitingBlock/g
...
llvm-svn: 41204
2007-08-20 23:51:18 +00:00
Chris Lattner
401698e8b5
initial checkin of Neil's APFloat work.
...
llvm-svn: 41203
2007-08-20 22:49:32 +00:00
Anton Korobeynikov
4e15adaf04
- Use correct header for SCEV inside LoopPass.cpp
...
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug
llvm-svn: 41197
2007-08-20 21:17:26 +00:00
Devang Patel
b6ebf8cbf3
Replace indunction variable with split value in loop body.
...
This fixes art miscompile.
llvm-svn: 41195
2007-08-20 20:49:01 +00:00
Devang Patel
6c91023dad
Do not split loops rejected by processOneIterationLoop().
...
llvm-svn: 41194
2007-08-20 20:24:15 +00:00
Dan Gohman
23db01efea
Minor cleanups to reduce some spurious differences between different
...
scheduler implementations.
llvm-svn: 41191
2007-08-20 19:28:38 +00:00
Dan Gohman
908f4e65ed
Add Type::isIntOrIntVector, like Type::isFPOrFPVector.
...
llvm-svn: 41190
2007-08-20 19:25:59 +00:00
Dan Gohman
5da3149de5
When Intrinsic::getName is constructing names for overloaded intrinsics,
...
use the ValueType name instead of the llvm type name, to match what the
verifier expects. For integers these are the same, but for floating-point
values the intrinsics use f32/f64 instead of float/double.
llvm-svn: 41189
2007-08-20 19:23:34 +00:00
Rafael Espindola
68d95ff2b1
Partial implementation of calling functions with byval arguments:
...
*) The needed information is propagated to the DAG
*) The X86-64 backend detects it and aborts
llvm-svn: 41179
2007-08-20 15:18:24 +00:00
Chris Lattner
fdb4d38108
add a note
...
llvm-svn: 41178
2007-08-20 02:14:33 +00:00
Chris Lattner
2de224be98
Fix PR1611 - Visibility should be ignored for a declaration
...
when a definition's visibility is different. Likewise, the
visibility of two declarations mismatching is not an error.
llvm-svn: 41174
2007-08-19 22:22:54 +00:00
Chris Lattner
a92fddf2cc
simplify code and print visibility for declarations.
...
llvm-svn: 41173
2007-08-19 22:15:26 +00:00
Nick Lewycky
3ea7d43047
Oops, remove assert that wasn't meant to be committed.
...
llvm-svn: 41170
2007-08-18 23:21:28 +00:00
Nick Lewycky
125c9f2db3
Never insert duplicate edges.
...
llvm-svn: 41169
2007-08-18 23:18:03 +00:00
Nick Lewycky
9570c4c5ca
Typo.
...
llvm-svn: 41168
2007-08-18 15:08:56 +00:00
Chris Lattner
d5f075ed16
Compute the argument list as lazily as possible. This ensures that clients
...
that don't use it don't have to pay the memory cost for the arguments. This
allows us to avoid creating Argument nodes for many prototypes and for clients
who lazily deserialize code from a bytecode file.
llvm-svn: 41166
2007-08-18 06:14:52 +00:00
Chris Lattner
6e6a77d83b
use a nicer accessor.
...
llvm-svn: 41165
2007-08-18 06:13:19 +00:00
Evan Cheng
a65c956119
Fold C ? 0 : 1 to ~C or zext(~C) or trunc(~C) depending the types.
...
llvm-svn: 41163
2007-08-18 05:57:05 +00:00
Bruno Cardoso Lopes
40b9999770
MipsHi now has ouput flag
...
MipsAdd SDNode created to add support to an Add opcode which supports input flag
Added an instruction itinerary to all instruction classes
Added branches with zero cond codes
Now call clobbers all non-callee saved registers
Call w/ register support added
Added DelaySlot to branch and load instructions
Added patterns to handle all setcc, brcond/setcc and MipsAdd instructions
llvm-svn: 41161
2007-08-18 02:37:46 +00:00
Bruno Cardoso Lopes
3bc582fa67
Fixed stack frame addressing bug
...
llvm-svn: 41160
2007-08-18 02:19:09 +00:00
Bruno Cardoso Lopes
15cbbbb56f
support for Schedule included on Mips.td
...
llvm-svn: 41159
2007-08-18 02:18:07 +00:00
Bruno Cardoso Lopes
e2909db54c
Removed LowerRETURADDR, fixed small bug into LowerRET, LowerGlobalAddress
...
fixed to generate instructions (add, lui) glued!
llvm-svn: 41158
2007-08-18 02:16:30 +00:00
Bruno Cardoso Lopes
d13e0b33d1
Couple of small changes. Delay Slot handle header declared.
...
Newline added after macros at function init on generated asm!
llvm-svn: 41157
2007-08-18 02:05:24 +00:00
Bruno Cardoso Lopes
1ad2687157
Added InstrItinClass support for instruction formats
...
llvm-svn: 41156
2007-08-18 02:01:28 +00:00
Bruno Cardoso Lopes
0dce1a316c
Branch Analysis and InsertNoop inserted into header files
...
llvm-svn: 41155
2007-08-18 01:59:45 +00:00
Bruno Cardoso Lopes
ae01dc5e74
createMipsDelaySlotFillerPass added to mips codegen runtime
...
llvm-svn: 41154
2007-08-18 01:58:15 +00:00
Bruno Cardoso Lopes
7bca87bebd
Added Branch Analysis support
...
Added InsertNoop support
llvm-svn: 41153
2007-08-18 01:56:48 +00:00
Bruno Cardoso Lopes
c7eaab9c92
LowerRETURNADDR removed since it was wrong and does not have utility yet!
...
MipsAdd opcode added
llvm-svn: 41152
2007-08-18 01:54:09 +00:00
Bruno Cardoso Lopes
d97285f98a
InstrItineraryData support on added.
...
Added Mips3 ISA feature (needed when supporting R4000 machines)
llvm-svn: 41151
2007-08-18 01:52:27 +00:00
Bruno Cardoso Lopes
bc755b9969
A Pass to insert Nops on intructions with DelaySlot
...
llvm-svn: 41150
2007-08-18 01:50:47 +00:00
Bruno Cardoso Lopes
d67580757e
Mips generic fallback instruction schedule support!
...
llvm-svn: 41149
2007-08-18 01:46:44 +00:00
Devang Patel
17cd20c077
Avoid spliting loops where two split condition branches are not independent.
...
llvm-svn: 41148
2007-08-18 00:00:32 +00:00
Devang Patel
fded73828f
When one branch of condition is eliminated then head of the other
...
branch is not necessary immediate dominators of merge blcok in all cases.
llvm-svn: 41144
2007-08-17 21:59:16 +00:00
Evan Cheng
930acafa5b
Avoid issue on 64-bit hosts.
...
llvm-svn: 41143
2007-08-17 18:02:22 +00:00
David Greene
1d1b7f793d
Fix GLIBCXX_DEBUG error of comparing two singular iterators
...
llvm-svn: 41139
2007-08-17 15:13:55 +00:00
Evan Cheng
11fa8d0f62
If dynamic_stackalloc alignment is > stack alignment, first issue an instruction to align the stack ptr before the decrement.
...
llvm-svn: 41133
2007-08-16 23:50:06 +00:00
Evan Cheng
9a05381a81
- If a dynamic_stackalloc alignment requirement is <= stack alignment, then the alignment argument is ignored.
...
- *Always* round up the size of the allocation to multiples of stack
alignment to ensure the stack ptr is never left in an invalid state after a dynamic_stackalloc.
llvm-svn: 41132
2007-08-16 23:46:29 +00:00
Owen Anderson
5173494693
Factor out some code into a helper function.
...
llvm-svn: 41131
2007-08-16 22:51:56 +00:00
Dan Gohman
644db457f0
Fix the verification for overloaded intrinsic types. Check that they are
...
what they're supposed to be before using them.
llvm-svn: 41130
2007-08-16 22:06:45 +00:00
Owen Anderson
70ac81f489
Add some more comments to GVN.
...
llvm-svn: 41129
2007-08-16 22:02:55 +00:00
Dan Gohman
b499ea1cf6
Add MVT::fAny for overloading intrinsics on floating-point types.
...
llvm-svn: 41128
2007-08-16 21:57:19 +00:00
Owen Anderson
03cbda804e
Cache non-local memory dependence analysis. This is a significant compile
...
time performance win in most cases.
llvm-svn: 41126
2007-08-16 21:27:05 +00:00
Chris Lattner
4c6c787315
This adds a bunch of static functions that implement unsigned
...
two's complement bignum arithmetic. They could be used to
implement much of APInt, but the idea is they are enough to
implement APFloat as well, which the current APInt interface
is not suited for.
Patch by Neil Booth!
llvm-svn: 41124
2007-08-16 15:56:55 +00:00
Reid Spencer
056b656f99
Improve error handling in the linker by:
...
1. Eliminate redundant error messages. LinkInFile and LinkInArchive
already call the error() method in each case so there's no use
telling the user again that an item couldn't be linked in.
2. Improve the formatting of error messages (separating content).
3. Change the wording for the warning about unrecognized files. Make
it clear that the file is being ignored.
llvm-svn: 41121
2007-08-16 07:47:30 +00:00
Evan Cheng
ee277f940b
Fix some kill info update bugs; add hidden option -disable-rematerialization to turn off remat for debugging.
...
llvm-svn: 41118
2007-08-16 07:24:22 +00:00
Reid Spencer
3860c113ab
Ensure that error messages a propagated from calls to LinkInModule so they get
...
reported to the end user.
llvm-svn: 41117
2007-08-16 07:23:37 +00:00
Lauro Ramos Venancio
9f9e5b3971
Implement FPOWI ExpandOp.
...
Fix PR1287.
llvm-svn: 41112
2007-08-15 22:13:27 +00:00
Anton Korobeynikov
958dcad32d
Properly use const qualifiers
...
llvm-svn: 41111
2007-08-15 21:12:30 +00:00
Evan Cheng
f758fa5c35
If the source of a move is in spill slot, the reload may be folded to essentially a load from stack slot. It's ok to mark the stack slot value as available for reuse. But it should not be clobbered since the destination of the move is live.
...
llvm-svn: 41109
2007-08-15 20:20:34 +00:00
Anton Korobeynikov
3094846993
Move ReturnAddrIndex variable to X86MachineFunctionInfo structure. This fixed
...
hard to catch bugs with retaddr lowering
llvm-svn: 41104
2007-08-15 17:12:32 +00:00
Chris Lattner
9fd664292f
add a note.
...
llvm-svn: 41103
2007-08-15 16:58:38 +00:00
Devang Patel
423d18e306
Dominance frontier is now required.
...
llvm-svn: 41096
2007-08-15 03:34:53 +00:00
Devang Patel
315ea9c519
Cleanup removeBlocks.
...
Use dominance frontier to fixup incoming edges of successor blocks not domianted by DeadBB.
Use df_iterator to walk and delete basic blocks dominated by DeadBB.
llvm-svn: 41095
2007-08-15 03:31:47 +00:00
Reid Spencer
2cfe29fc0b
Remove unneeded header file.
...
llvm-svn: 41094
2007-08-15 03:01:04 +00:00
Devang Patel
b0924a406a
Avoid triangle loops.
...
llvm-svn: 41093
2007-08-15 02:14:55 +00:00
Devang Patel
1dd44d7501
Break infinite loop.
...
llvm-svn: 41091
2007-08-14 23:59:17 +00:00
Devang Patel
d39b9d41bb
Avoid nested loops at the moment.
...
llvm-svn: 41090
2007-08-14 23:53:57 +00:00
Evan Cheng
70879e8dae
- If a def is dead, do not spill it.
...
- If the defs of a spilled rematerializable MI are dead after the spill store is deleted, delete
the def MI as well.
llvm-svn: 41086
2007-08-14 23:25:37 +00:00
Evan Cheng
f901915207
Fix for PR1596: AdjustCopiesBackFrom() should conservatively check if any of its sub-registers may overlap with the interval of the copy that's being coalesced.
...
llvm-svn: 41084
2007-08-14 23:19:28 +00:00
Evan Cheng
0fbe2a0ec4
If a MI's def is remat as well as spilled, and the store is later deemed dead, mark the def operand as isDead.
...
llvm-svn: 41083
2007-08-14 20:23:13 +00:00
Devang Patel
7ff808f08e
Fix dominance frontier update while removing blocks.
...
llvm-svn: 41082
2007-08-14 18:35:57 +00:00
Owen Anderson
b970937b06
Eliminate PHI nodes with constant values during normal GVN processing, even when
...
they're not related to eliminating a load.
llvm-svn: 41081
2007-08-14 18:33:27 +00:00
Owen Anderson
d9a7b61a64
Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
...
llvm-svn: 41080
2007-08-14 18:16:29 +00:00
Owen Anderson
c855195b2f
Make GVN iterative.
...
llvm-svn: 41078
2007-08-14 18:04:11 +00:00
Owen Anderson
8d15350c4e
Fix a case where GVN was failing to return true when it had, in fact, modified
...
the function.
llvm-svn: 41077
2007-08-14 17:59:48 +00:00
Devang Patel
833a8ea187
Assert sooner. Fix wordings.
...
llvm-svn: 41075
2007-08-14 16:53:52 +00:00
Evan Cheng
de24ad8897
If a spilled value is being reused and the use is a kill, that means there are
...
no more uses within the MBB and the spilled value isn't live out of the MBB.
Then it's safe to delete the spill store.
llvm-svn: 41069
2007-08-14 09:11:18 +00:00
Evan Cheng
886c1fe427
If a rematerializable def is not deleted, i.e. it is also spilled, check if the
...
spilled value is available for reuse.
llvm-svn: 41067
2007-08-14 05:42:54 +00:00
Evan Cheng
5b64e19e06
Kill info update bugs.
...
llvm-svn: 41064
2007-08-14 01:56:58 +00:00
Devang Patel
5d8b2b3293
Handle last value assignments.
...
llvm-svn: 41063
2007-08-14 01:30:57 +00:00
Devang Patel
55b6a8f212
StartValue is already calculated.
...
llvm-svn: 41062
2007-08-14 00:15:45 +00:00
Evan Cheng
215f802b75
Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.
...
llvm-svn: 41060
2007-08-13 23:45:17 +00:00
Evan Cheng
eef13203e7
Fix a typo pointd out by Maarten ter Huurne.
...
llvm-svn: 41059
2007-08-13 23:27:11 +00:00
Devang Patel
762259ba73
Preserve simple analysis.
...
llvm-svn: 41054
2007-08-13 22:22:13 +00:00
Devang Patel
e3ea62e49a
Preserve dominator info.
...
llvm-svn: 41053
2007-08-13 22:13:24 +00:00
Devang Patel
993388b1ee
Add methods to erase basic block entry.
...
llvm-svn: 41052
2007-08-13 22:10:29 +00:00
Devang Patel
d1d0316041
If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.
...
llvm-svn: 41051
2007-08-13 21:59:17 +00:00
Chris Lattner
80032c89e6
move assertion into mutex guard, a partial fix for PR1606.
...
llvm-svn: 41050
2007-08-13 20:08:16 +00:00
Dan Gohman
2390ff5060
When x86 addresses matching exceeds its recursion limit, check to
...
see if the base register is already occupied before assuming it can be
used. This fixes bogus code generation in the accompanying testcase.
llvm-svn: 41049
2007-08-13 20:03:06 +00:00
Chris Lattner
7dfec1ee54
Fix PR1607
...
llvm-svn: 41048
2007-08-13 18:42:37 +00:00
Chris Lattner
8674db5fbf
Constant fold: getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1)
...
Into: inttoptr (i64 0 to i8*) -> null
This occurs in the example in PR1602. With this fixed, we now compile
the example in PR1602 into fully "devirtualized" code:
define void @_Z1g1S(%struct.S* noalias %s) {
entry: %tmp131415 = getelementptr %struct.S* %s, i32 0, i32 0 ; <i32 (...)***> [#uses=1] %tmp16 = load i32 (...)*** %tmp131415, align 4 ; <i32 (...)**> [#uses=1]
%tmp26277 = load i32 (...)** %tmp16 ; <i32 (...)*> [#uses=1]
%tmp2829 = bitcast i32 (...)* %tmp26277 to void (%struct.S*)* ; <void (%struct.S*)*> [#uses=1]
tail call void %tmp2829( %struct.S* %s )
ret void
}
This still has the vtable dispatch (as required) but does not have any pointer
to method cruft left.
llvm-svn: 41046
2007-08-13 17:09:08 +00:00
Evan Cheng
54b799dc76
Kill info update bugs.
...
llvm-svn: 41043
2007-08-13 07:12:23 +00:00
Devang Patel
63d1affed8
Split loops and do CFG cleanup.
...
llvm-svn: 41029
2007-08-12 07:02:51 +00:00
Reid Spencer
c71871ba30
Remove unused variables.
...
llvm-svn: 41028
2007-08-12 04:45:36 +00:00
Evan Cheng
3b211635e8
No need to remove dead range from soon-to-be-dead live interval. Its val# may be out of whack.
...
llvm-svn: 41024
2007-08-12 01:26:19 +00:00
Chris Lattner
afb3c33c2a
constant fold ptrtoint(inttoptr) with target data when available. This allows
...
us to fold the entry block of PR1602 to false instead of:
br i1 icmp eq (i32 and (i32 ptrtoint (void (%struct.S*)* inttoptr (i64
1 to void (%struct.S*)*) to i32), i32 1), i32 0), label %cond_next, label
%cond_true
llvm-svn: 41023
2007-08-11 23:49:01 +00:00
Chris Lattner
50f25115cd
Transform a load from an undef/zero global into an undef/global even if we
...
have complex pointer manipulation going on. This allows us to compile
stuff like this:
__m128i foo(__m128i x){
static const unsigned int c_0[4] = { 0, 0, 0, 0 };
__m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
x = _mm_unpacklo_epi8(x, v_Zero);
return x;
}
into:
_foo:
xorps %xmm1, %xmm1
punpcklbw %xmm1, %xmm0
ret
llvm-svn: 41022
2007-08-11 18:48:48 +00:00
Chris Lattner
fedbfd5f47
expand a note
...
llvm-svn: 41021
2007-08-11 18:19:07 +00:00
Chris Lattner
5f098dbbe5
With evan's explicit flag representation, hopefully we will finally be
...
able to 3-addressify away stuff like this:
movl %ecx, %eax
decl %eax
llvm-svn: 41020
2007-08-11 18:16:46 +00:00
Reid Spencer
da7379cc57
Fix a comment typo noticed by Sandro Magi.
...
llvm-svn: 41018
2007-08-11 15:57:56 +00:00
Bill Wendling
e611c96a3c
64-bit SSSE3 ops that use MMX registers don't require 16-byte alignment.
...
Make a 'memop' pattern just for them.
llvm-svn: 41017
2007-08-11 09:52:53 +00:00
Evan Cheng
8968affb6d
Code to maintain kill information during register coalescing.
...
llvm-svn: 41016
2007-08-11 00:59:19 +00:00
Christopher Lamb
7e52a97df5
Use subregs to improve any_extend code generation when feasible.
...
llvm-svn: 41013
2007-08-10 22:22:41 +00:00
Christopher Lamb
450f6815b9
Increase efficiency of sign_extend_inreg by using subregisters for truncation. As the README suggests sign_extend_subreg is selected to (sext(trunc)).
...
llvm-svn: 41010
2007-08-10 21:48:46 +00:00
Christopher Lamb
4e6cae3eae
Edit README in light of previous LEA16 commit.
...
llvm-svn: 41009
2007-08-10 21:29:05 +00:00
Christopher Lamb
7196f0d724
Add 2-addr to 3-addr promotion code that allows 32-bit LEA to be used via subregisters when 16-bit LEA is disabled.
...
llvm-svn: 41007
2007-08-10 21:18:25 +00:00
Christopher Lamb
e0c9bd8d2e
Move isSubRegOf into MRegisterInfo. Fix a missed move elimination in LowerSubregs and add more debugging output there.
...
llvm-svn: 41005
2007-08-10 21:11:55 +00:00
Devang Patel
fa7277dd34
Do not overuse std::string. Pass around char * directly.
...
llvm-svn: 41001
2007-08-10 18:29:32 +00:00
Devang Patel
c8cff19c2e
Clone loop.
...
llvm-svn: 40998
2007-08-10 18:07:13 +00:00
Devang Patel
d412a2a0ed
Add utility to clone loops.
...
llvm-svn: 40997
2007-08-10 17:59:47 +00:00
Chris Lattner
de900e3b6c
add Value::getNameStart/getNameLen() accessors.
...
llvm-svn: 40989
2007-08-10 15:34:35 +00:00
Dan Gohman
f18e94535f
Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
...
use an intptr ValueType instead of i32 for the index operand in
getCopyToParts.
llvm-svn: 40987
2007-08-10 14:59:38 +00:00
Rafael Espindola
b20b9e985a
propagate struct size and alignment of byval arguments to the DAG
...
llvm-svn: 40986
2007-08-10 14:44:42 +00:00
Bill Wendling
d0bee665d3
For kicks, I though it would be fun to use the correct opcode.
...
llvm-svn: 40985
2007-08-10 09:00:17 +00:00
Bill Wendling
55c3dc2409
Adding SSSE3 intrinsics.
...
llvm-svn: 40982
2007-08-10 06:22:27 +00:00
Chris Lattner
de5f6f921a
minor simplifications.
...
llvm-svn: 40981
2007-08-10 06:22:25 +00:00
Chris Lattner
bbe3b1dbee
avoid copying strings.
...
llvm-svn: 40980
2007-08-10 06:17:04 +00:00
Devang Patel
b1160475fd
Remove unncessary duplication.
...
llvm-svn: 40979
2007-08-10 00:59:03 +00:00
Devang Patel
23c5e2dcd3
Calculate exit and start value of true loop and false loop respectively.
...
llvm-svn: 40978
2007-08-10 00:53:35 +00:00
Devang Patel
51da0a465a
ExitCondition and Induction variable are loop constraints
...
not split condition constraints.
llvm-svn: 40977
2007-08-10 00:33:50 +00:00
Chris Lattner
202e7f84e9
unbreak the build
...
llvm-svn: 40976
2007-08-09 23:55:17 +00:00
Evan Cheng
0293fe7483
Bug fix. ~1U marks the val# dead.
...
llvm-svn: 40975
2007-08-09 23:14:39 +00:00
Dale Johannesen
21c0eac378
Patch 10 for long double. Doing constants right needs expanding ConstantFP
...
to handle values bigger than double. If we assume host==target and host
long double works correctly, this is not too bad, but we don't want to
have that limitation longterm. I could implement accepting double
constants as long double or something like that, which would lead to
incorrect codegen with no errors; the more I think about that the worse
it seems. Rather than do such a hack that would be backed out later,
I'm settling for giving reasonable error messages, for now.
llvm-svn: 40974
2007-08-09 22:51:36 +00:00
Evan Cheng
3fae8e1c4a
Temporarily backing out this change until we know why some dejagnu tests are failing.
...
llvm-svn: 40973
2007-08-09 22:25:35 +00:00
Evan Cheng
a58ebc46dd
divb / mulb outputs to ah. Under x86-64 it's not legal to read ah if the instruction requires a rex prefix (i.e. outputs to r8b, etc.). So issue shift right by 8 on AX and then truncate it to 8 bits instead.
...
llvm-svn: 40972
2007-08-09 21:59:35 +00:00
Chris Lattner
3548932573
when we see a unaligned load from an insufficiently aligned global or
...
alloca, increase the alignment of the load, turning it into an aligned load.
This allows us to compile:
#include <xmmintrin.h>
__m128i foo(__m128i x){
static const unsigned int c_0[4] = { 0, 0, 0, 0 };
__m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
x = _mm_unpacklo_epi8(x, v_Zero);
return x;
}
into:
_foo:
punpcklbw _c_0.5944, %xmm0
ret
.data
.lcomm _c_0.5944,16,4 # c_0.5944
instead of:
_foo:
movdqu _c_0.5944, %xmm1
punpcklbw %xmm1, %xmm0
ret
.data
.lcomm _c_0.5944,16,2 # c_0.5944
llvm-svn: 40971
2007-08-09 19:05:49 +00:00
Evan Cheng
a822456bed
GR16_ sub-register class should be GR8_, not GR8. That is, it should only be 8-bit registers in 32-bit mode. Ditto for GR32_.
...
llvm-svn: 40970
2007-08-09 18:05:17 +00:00
Dale Johannesen
a1340d5916
Update per review comments.
...
llvm-svn: 40965
2007-08-09 17:27:48 +00:00
Owen Anderson
3eba1e8f5c
Make NonLocal and None const in the right way. :-)
...
llvm-svn: 40961
2007-08-09 04:42:44 +00:00
Devang Patel
652613b1db
Traverse loop blocks' terminators to find split candidates.
...
llvm-svn: 40960
2007-08-09 01:39:01 +00:00
Dale Johannesen
79551baaad
long double 9 of N. This finishes up the X86-32 bits
...
(constants are still not handled). Adds ConvertActions
to control fp-to-fp conversions (these are currently
defaulted for all other targets, so no changes there).
llvm-svn: 40958
2007-08-09 01:04:01 +00:00
Dale Johannesen
6c8f73eac6
Fix arguments for some Altivec instructions. From SWB.
...
llvm-svn: 40957
2007-08-09 00:49:19 +00:00
Scott Michel
86052f49c0
If a target really needs to custom lower constants, it should be allowed
...
to do so.
llvm-svn: 40955
2007-08-08 23:23:31 +00:00
Owen Anderson
3db807751b
Add more comments to memdep.
...
llvm-svn: 40953
2007-08-08 22:26:03 +00:00
Devang Patel
30bf54b9d3
Add cost analysis.
...
llvm-svn: 40952
2007-08-08 22:25:28 +00:00
Owen Anderson
d791c9f667
Make memdep fit in 80 cols.
...
llvm-svn: 40950
2007-08-08 22:01:54 +00:00
Devang Patel
ed9b08c44f
Preserve dom info while processing one iteration loop.
...
llvm-svn: 40947
2007-08-08 21:39:47 +00:00
Owen Anderson
f988c3ee5c
Change the None and NonLocal markers in memdep to be const.
...
llvm-svn: 40946
2007-08-08 21:39:39 +00:00
Devang Patel
a74e533c5e
Clear split info.
...
llvm-svn: 40944
2007-08-08 21:18:27 +00:00
Devang Patel
4bd07b86ae
Handle multiple split conditions.
...
llvm-svn: 40941
2007-08-08 21:02:17 +00:00
Reid Spencer
e8aa5a5832
Make getSTDIN return null if the standard input is empty, as the header file
...
documentation implies and as its uses depend.
llvm-svn: 40939
2007-08-08 20:01:58 +00:00
Reid Spencer
c5f311aa70
Allow the filename "-" to be a place holder for stdin. This allows directing
...
stdin through llvm-ld and llvm-link.
llvm-svn: 40938
2007-08-08 19:52:29 +00:00
Owen Anderson
04ba98d0f5
Global values also don't undead-ify pointers in our dead alloca's set.
...
llvm-svn: 40936
2007-08-08 19:12:31 +00:00
Owen Anderson
fd772509e9
Make handleEndBlock significantly faster with one trivial improvement,
...
and one hack to avoid hitting a bad case when the alias analysis is imprecise.
llvm-svn: 40935
2007-08-08 18:38:28 +00:00
Owen Anderson
930610cceb
Small improvement: if a function doesn't access memory, we don't need to scan
...
it for potentially undeading pointers.
llvm-svn: 40933
2007-08-08 17:58:56 +00:00
Owen Anderson
ecd9348bd6
Add some comments, remove a dead argument, and simplify some control flow.
...
No functionality change.
llvm-svn: 40932
2007-08-08 17:50:09 +00:00
Chris Lattner
a7dce8c173
eliminate redundant conditions from the signless types conversion.
...
llvm-svn: 40927
2007-08-08 16:19:57 +00:00