Evan Cheng
f593a65497
Undo spill weight tweak. Need to investigate the performance regressions.
...
llvm-svn: 52572
2008-06-21 06:45:54 +00:00
Dan Gohman
4b49be1cbe
Simplify some template parameterization.
...
llvm-svn: 52571
2008-06-21 01:08:22 +00:00
Evan Cheng
33067210d1
Back out Matthijs' DAE patches. It's miscompiling gcc driver.
...
llvm-svn: 52570
2008-06-21 00:31:44 +00:00
Ted Kremenek
4c32155a0f
Updated VS build system. Patch provided by Cedric Venet:
...
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-June/015446.html
llvm-svn: 52564
2008-06-20 22:19:12 +00:00
Evan Cheng
efc67e78d7
Enhanced heuristic to determine the *best* register to spill. Instead of picking the register with the lowest spill weight. Consider (up to) 2 additional registers with spill weights that are close to the lowest spill weight. The one with fewest defs and uses that conflicts with the current interval (weighted by loop depth) is the spill candidate.
...
This is not always a win, but there are much more wins than loses and wins tend to be more noticeable.
llvm-svn: 52554
2008-06-20 21:45:16 +00:00
Chris Lattner
e4645615d3
integer types are not primitive, they are derived.
...
llvm-svn: 52551
2008-06-20 20:50:48 +00:00
Owen Anderson
d1cb6e2466
llvmc doesn't exist anymore, and llvmc2 doesn't have a special license file.
...
llvm-svn: 52550
2008-06-20 20:05:57 +00:00
Duncan Sands
f362183c24
Share some code that is common between integer and
...
float expansion (and sometimes vector splitting too).
llvm-svn: 52548
2008-06-20 18:40:50 +00:00
Duncan Sands
b6a90ccaee
Add some methods for querying the nature of a
...
store, like the methods for loads (and neaten
those up a bit while there).
llvm-svn: 52547
2008-06-20 18:34:30 +00:00
Duncan Sands
49295b48eb
Rename the operation of turning a float type into an
...
integer of the same type. Before it was "promotion",
but this is confusing because it is quite different
to promotion of integers. Call it "softening" instead,
inspired by "soft float".
llvm-svn: 52546
2008-06-20 17:49:55 +00:00
Dan Gohman
3792c470d5
Clean up some uses of std::distance, now that we have allnodes_size.
...
llvm-svn: 52545
2008-06-20 17:15:19 +00:00
Dan Gohman
3ada1e118b
Clean up a use of std::distance.
...
llvm-svn: 52544
2008-06-20 17:11:32 +00:00
Dan Gohman
a5dd67f002
Tidy up some commments and use the getAggregateOperand and
...
getInsertedValueOperand accessors. Thanks Matthijs!
llvm-svn: 52543
2008-06-20 16:41:17 +00:00
Dan Gohman
b5210efb31
Fix the conditions under which SCCP should examine insertvalue
...
instructions. Thanks to Matthijs Kooijman for pointing this out!
llvm-svn: 52542
2008-06-20 16:39:44 +00:00
Dan Gohman
795e2943a2
Add an allnodes_size method.
...
llvm-svn: 52541
2008-06-20 16:03:16 +00:00
Matthijs Kooijman
48b282f03b
Add testcase that checks that DeadArgElim doesn't touch stuff it shouldn't touch.
...
llvm-svn: 52540
2008-06-20 15:38:22 +00:00
Matthijs Kooijman
c456f9dfc6
80 column and trailing whitespace fixes.
...
llvm-svn: 52539
2008-06-20 15:34:07 +00:00
Matthijs Kooijman
0c50b953c5
Don't let DeadArgumentElimination attempt to update callers when the return
...
type wasn't changed.
llvm-svn: 52538
2008-06-20 15:25:43 +00:00
Matthijs Kooijman
9dc59b7666
Don't let DeadArgElimination change the return type ({} into void and {T}
...
into T) when no return values are actually dead.
llvm-svn: 52537
2008-06-20 15:16:45 +00:00
Matthijs Kooijman
013b6a9a42
Explicitely track if any arguments or return values were removed in
...
DeadArgumentElimination and assert that the function type does not change if
nothing was changed. This should catch subtle changes in function type that are
not intended.
llvm-svn: 52536
2008-06-20 14:28:52 +00:00
Matthijs Kooijman
e91aed6ce1
Remove debug output.
...
llvm-svn: 52535
2008-06-20 14:03:35 +00:00
Matthijs Kooijman
8d32dee428
Recommit r52459, rewriting of the dead argument elimination pass.
...
This is a fixed version that no longer uses multimap::equal_range, which
resulted in a pointer invalidation problem.
Also, DAE::InspectedFunctions was not really necessary, so it got removed.
Lastly, this version no longer applies the extra arg hack on functions who did
not have any arguments to start with.
llvm-svn: 52532
2008-06-20 09:36:16 +00:00
Owen Anderson
78fbcafb53
Really disable PRE.
...
llvm-svn: 52531
2008-06-20 08:59:13 +00:00
Chris Lattner
2616a7e0f7
"Just a small update for the project files for adding a missing preprocessor
...
definition for VS2005 (without SP1). It suppress the (bogus) M$ deprecated
warning."
Patch by Cédric Venet!
llvm-svn: 52530
2008-06-20 05:35:58 +00:00
Chris Lattner
54d26c6b12
Fix a warning, closing PR2452
...
llvm-svn: 52529
2008-06-20 05:33:29 +00:00
Chris Lattner
65ee4e3a5c
Fix a warning.
...
llvm-svn: 52528
2008-06-20 05:31:04 +00:00
Chris Lattner
d53bd2da98
Fix an error handling redefinition of linkonce functions where the
...
types differ. Patch by Nathan Keynes!
llvm-svn: 52527
2008-06-20 05:29:39 +00:00
Chris Lattner
ba00c761b7
fix a warning.
...
llvm-svn: 52526
2008-06-20 05:28:56 +00:00
Chris Lattner
f3ecd2d290
Fix PR2471, which is a bug involving an invalid promotion from a conditional load.
...
llvm-svn: 52525
2008-06-20 05:12:56 +00:00
Chris Lattner
643b00a3e6
Fix typo, fix suggested by Nicholas Olsen
...
llvm-svn: 52524
2008-06-20 05:03:17 +00:00
Gordon Henriksen
9f337549a7
Add C binding for ExecutionEngine::addGlobalMapping.
...
llvm-svn: 52523
2008-06-20 02:16:11 +00:00
Dan Gohman
593a010c56
Teach ReturnInst lowering about aggregate return values.
...
llvm-svn: 52522
2008-06-20 01:29:26 +00:00
Owen Anderson
1b3ea963f7
Change around the data structures used to store availability sets, resulting in a GVN+PRE that is faster that GVN alone was before.
...
llvm-svn: 52521
2008-06-20 01:15:47 +00:00
Dan Gohman
041f9d03ff
Teach SCCP about insertvalue and extractvalue, and about
...
propagating constants across aggregate return values when
insertvalue and extractvalue are used.
llvm-svn: 52520
2008-06-20 01:15:44 +00:00
Dan Gohman
3b18fd7b02
Teach InlineFunction how to differentiate between multiple-value
...
return statements and aggregate returns so that it handles both
correctly.
llvm-svn: 52519
2008-06-20 01:03:44 +00:00
Evan Cheng
9598f930f3
Disable PRE for now. It seems to be breaking llvm-gcc bootstrapping.
...
llvm-svn: 52518
2008-06-20 01:01:07 +00:00
Dan Gohman
44b2c57e2b
Fix the index calculations for the extractvalue lowering code.
...
llvm-svn: 52517
2008-06-20 00:54:19 +00:00
Dan Gohman
c7a32fc8ca
Simplify the ComputeLinearIndex logic and fix a few bugs.
...
llvm-svn: 52516
2008-06-20 00:53:00 +00:00
Dan Gohman
e8512ffba6
It's invalid to take the one-past-the-end address of a non-array
...
object.
llvm-svn: 52515
2008-06-20 00:49:21 +00:00
Dan Gohman
d87e813e41
Simplify this code. Thanks Chris!
...
llvm-svn: 52514
2008-06-20 00:47:44 +00:00
Evan Cheng
be0429c558
ISD::UNDEF should be expanded recursively / iteratively.
...
llvm-svn: 52508
2008-06-19 22:01:11 +00:00
Owen Anderson
e780d66657
Add a hidden -disable-pre flag for testing purposes. This should be removed
...
once benchmarking is completed.
llvm-svn: 52506
2008-06-19 19:57:25 +00:00
Owen Anderson
fdf9f168b5
PRE requires that critical edges be split.
...
llvm-svn: 52505
2008-06-19 19:54:19 +00:00
Bill Wendling
cd6fb1d0a8
Remove dead code causing a warning.
...
llvm-svn: 52502
2008-06-19 18:00:44 +00:00
Dan Gohman
d6530872f3
Use the common API for adding instructions to basic blocks instead of
...
using BasicBlock::getInstList.
llvm-svn: 52500
2008-06-19 17:53:32 +00:00
Owen Anderson
ff21db851d
Be sure to remove values from the value numbering table after we delete them.
...
This fixes a failure on povray.
llvm-svn: 52499
2008-06-19 17:53:26 +00:00
Dan Gohman
ed2250990a
Use Instruction::moveBefore instead of manipulating the instruction list
...
directly.
llvm-svn: 52498
2008-06-19 17:47:47 +00:00
Dan Gohman
9eea470fcf
Avoid using BasicBlock::getInstList directly in a few places.
...
llvm-svn: 52497
2008-06-19 17:37:25 +00:00
Owen Anderson
45d3701fce
Revert support for insertvalue and extractvalue instructions for the moment.
...
GVN expects that all inputs which to an instruction fall somewhere in the value
hierarchy, which isn't true for these.
llvm-svn: 52496
2008-06-19 17:25:39 +00:00
Dan Gohman
6f880690b8
Use the transferSuccessors helper function.
...
llvm-svn: 52495
2008-06-19 17:22:29 +00:00
Dan Gohman
68f539e807
Delete dead code.
...
llvm-svn: 52494
2008-06-19 17:18:39 +00:00
Owen Anderson
eb31adeba4
Add an idx_iterator to the insertvalue and extractvalue instructions.
...
llvm-svn: 52493
2008-06-19 17:15:57 +00:00
Dan Gohman
386c2f616f
The inline keyword goes before the return type. This fixes a compiler warning.
...
llvm-svn: 52492
2008-06-19 16:16:06 +00:00
Matthijs Kooijman
a087b73dba
Modify some ipconstprop tests to also test with invokes.
...
llvm-svn: 52491
2008-06-19 09:27:44 +00:00
Matthijs Kooijman
0c71732497
Use a CallSite to find the nth argument of a call/invoke instruction instead of
...
using getOperand() directly. This makes things work with invoke instructions as
well.
llvm-svn: 52489
2008-06-19 08:53:24 +00:00
Duncan Sands
db356eea26
Fix some warnings reported by gcc-4.3. Hopefully
...
this still compiles on windows - I can't test!
llvm-svn: 52488
2008-06-19 08:47:31 +00:00
Evan Cheng
849fa11f15
Missed a check.
...
llvm-svn: 52487
2008-06-19 06:17:19 +00:00
Eli Friedman
8d66e98c92
Fix a bug with <8 x i16> shuffle lowering on X86 where parts of the
...
shuffle could be skipped. The check is invalid because the loop index i
doesn't correspond to the element actually inserted. The correct check is
already done a few lines earlier, for whether the element is already in
the right spot, so this shouldn't have any effect on the codegen for
code that was already correct.
llvm-svn: 52486
2008-06-19 06:09:51 +00:00
Owen Anderson
3c4ccc830e
Revert my last patch, which was causing regression test failures.
...
llvm-svn: 52485
2008-06-19 05:29:34 +00:00
Evan Cheng
b139ee95b4
New test case.
...
llvm-svn: 52483
2008-06-19 01:50:24 +00:00
Evan Cheng
d6d9cfa72a
This also got better (55 - 51 instructions). But doing one more re-materialization.
...
llvm-svn: 52482
2008-06-19 01:50:13 +00:00
Evan Cheng
1d1907d778
This got better.
...
llvm-svn: 52481
2008-06-19 01:46:43 +00:00
Evan Cheng
0c8ef553f5
Coalesce copy from one register class to a sub register class. e.g. X86::MOV16to16_.
...
llvm-svn: 52480
2008-06-19 01:39:21 +00:00
Evan Cheng
18e46d455b
Cosmetic changes.
...
llvm-svn: 52479
2008-06-19 01:21:26 +00:00
Evan Cheng
2dbba985d5
Unneeded include's.
...
llvm-svn: 52478
2008-06-19 01:21:02 +00:00
Evan Cheng
55bc848640
Minor spiller tweak to unfavor reload into load/store instructions.
...
llvm-svn: 52477
2008-06-19 01:16:17 +00:00
Owen Anderson
80ef880b98
Insert empty slots into the instruction numbering in live intervals, so that we can more easily
...
add new instructions.
llvm-svn: 52475
2008-06-19 00:10:49 +00:00
Owen Anderson
83c6a9d7c1
Remove this test until the corresponding patch is reapplied because it's causing make check to crash for some people.
...
llvm-svn: 52473
2008-06-18 22:37:31 +00:00
Owen Anderson
3ea800fbad
Add support for extractvalue and insertvalue instructions in GVN.
...
llvm-svn: 52472
2008-06-18 21:59:00 +00:00
Owen Anderson
6a903bc601
Add local PRE to GVN. This only operates in cases where it would not increase code size, namely when the instantiated expression
...
would only need to be created in one predecessor.
llvm-svn: 52471
2008-06-18 21:41:49 +00:00
Bill Wendling
573e0fd68b
Refactor the way to get a string containing the features of the target.
...
llvm-svn: 52470
2008-06-18 21:39:02 +00:00
Argyrios Kyrtzidis
55a8524241
Fix the source line debug information for the Windows platform.
...
According to DWARF-2 specification, the line information is provided through an offset in the .debug_line section.
Replace the label reference that is used with a section offset.
llvm-svn: 52468
2008-06-18 19:27:37 +00:00
Dan Gohman
08783a88a2
Fix a missing comma spotted by Bram Geron.
...
llvm-svn: 52467
2008-06-18 18:42:13 +00:00
Chris Lattner
78119b4742
Fix the regressions on sext-misc.ll my patch yesterday caused.
...
llvm-svn: 52466
2008-06-18 18:11:55 +00:00
Owen Anderson
9094cc957e
Revert r52459, which was causing an infinite loop or massive slowdown on MultiSource/Applications/SPASS, and possibly others as well.
...
Please reapply once this is fixed.
llvm-svn: 52465
2008-06-18 17:32:16 +00:00
Dan Gohman
095ca74a7f
Move SCEVExpander::visitAddExpr out-of-line.
...
llvm-svn: 52464
2008-06-18 16:37:11 +00:00
Dan Gohman
be928e3b21
Move LSR's private isZero function to a public SCEV member
...
function, and make use of it in several places.
llvm-svn: 52463
2008-06-18 16:23:07 +00:00
Gabor Greif
687f35f466
fix validator warning
...
llvm-svn: 52461
2008-06-18 14:05:31 +00:00
Gabor Greif
095502edfe
prettify, no semantic changes
...
llvm-svn: 52460
2008-06-18 13:44:57 +00:00
Matthijs Kooijman
964557fdf5
Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
...
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.
The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).
Also add a testcase for testing various variations of (multiple) dead rerturn
values.
llvm-svn: 52459
2008-06-18 11:12:53 +00:00
Matthijs Kooijman
fd17357643
Reapply r52397 (make IPConstProp promote returned arguments), but fixed this
...
time. Sorry for the trouble!
This time, also add a testcase, which I should have done in the first place...
llvm-svn: 52455
2008-06-18 08:30:37 +00:00
Evan Cheng
1d260dfa3b
XOR32rr, etc. are not AsCheapAsMove, but MOV32ri, etc. are.
...
llvm-svn: 52454
2008-06-18 08:13:07 +00:00
Matthijs Kooijman
97034598b1
Reapply r52396, it was unrelated to the breakage (that was caused by r52397, my
...
commit after this).
llvm-svn: 52453
2008-06-18 08:09:27 +00:00
Evan Cheng
c5618ebdb9
Complete support for two-address pass rematerialization. Now *almost* always a win.
...
llvm-svn: 52452
2008-06-18 07:49:14 +00:00
Evan Cheng
84da6318ca
Add MachineRegisterInfo::use_empty.
...
llvm-svn: 52451
2008-06-18 07:47:55 +00:00
Evan Cheng
50d59478da
Cosmetic.
...
llvm-svn: 52450
2008-06-18 07:47:28 +00:00
Bill Wendling
9b2c5730b3
If compiling for PPC on an i386 box, the LTO wouldn't get the altivec (and
...
other) feature information. The workaround is inelegant and could be cleaned up
if this information were available some other way (say, in the IR).
llvm-svn: 52447
2008-06-18 06:35:30 +00:00
Chris Lattner
ef36dcd10b
implement some simple bswap optimizations, rdar://5992453
...
llvm-svn: 52442
2008-06-18 04:33:20 +00:00
Chris Lattner
466e1f8dd2
temporarily revert this testcase since its patch was reverted.
...
llvm-svn: 52441
2008-06-18 04:03:23 +00:00
Chris Lattner
b5ee8b3e89
make truncate/sext elimination capable of changing phi's. This
...
implements rdar://6013816 and the testcase in Transforms/InstCombine/sext-misc.ll.
llvm-svn: 52440
2008-06-18 04:00:49 +00:00
Evan Cheng
f6a1466829
Unbreak DECLARE isel in pic mode.
...
llvm-svn: 52439
2008-06-18 02:48:27 +00:00
Devang Patel
cd6b697945
Preserve dominance frontier while trivially unswitching loop.
...
llvm-svn: 52438
2008-06-18 02:16:38 +00:00
Devang Patel
772a008738
Check empty dominance frontier.
...
llvm-svn: 52437
2008-06-18 02:12:09 +00:00
Dan Gohman
7cc14c55da
Auto-upgrade code for multiple-value return statements. This code
...
isn't actually called yet.
llvm-svn: 52435
2008-06-17 23:38:43 +00:00
Dan Gohman
d8ca05f4ee
In InsertValueInst's copy ctor, actually copy the operands.
...
llvm-svn: 52434
2008-06-17 23:25:49 +00:00
Owen Anderson
75f3732b23
We don't want to find dependencies within the same block in this case. It leads to incorrect results because
...
we're detecting something at or after the call we're querying on.
llvm-svn: 52433
2008-06-17 22:27:06 +00:00
Dan Gohman
4a3125ba29
Implement the ExtractValueInst::getIndexedType that accepts one
...
index value.
llvm-svn: 52432
2008-06-17 21:07:55 +00:00
Evan Cheng
f873ed1b10
Live-through live interval is [mbb start, mbb end+1].
...
llvm-svn: 52431
2008-06-17 20:13:36 +00:00
Evan Cheng
1eb69314fa
When extending a liveinterval by commuting, don't throw away the live ranges that are not affected.
...
llvm-svn: 52430
2008-06-17 20:11:16 +00:00
Ted Kremenek
90ada832be
Consistently set "Buckets[NumBuckets] = reinterpret_cast<void*>(-1)" throughout FoldingSet.cpp.
...
llvm-svn: 52425
2008-06-17 19:12:43 +00:00