Commit Graph

10712 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
9b90d7eae2 Count uses in all nested loops, not just the deepest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:12 +00:00
Jakob Stoklund Olesen
fc3ef3c2e9 Remove SplitAnalysis::removeUse. It was only used to make SplitAnalysis
reusable, but that is no longer relevant since a split will always replace the
original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:09 +00:00
Jakob Stoklund Olesen
d00f7e0c76 dupli always has an interval now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:04 +00:00
Jakob Stoklund Olesen
2e2be60e03 We can split around loops with multiple exits now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:35 +00:00
Jakob Stoklund Olesen
57d0f2deb0 Update SplitEditor API to reflect the fact that the original live interval is
never kept after splitting.

Keeping the original interval made sense when the split region doesn't modify
the register, and the original is spilled. We can get the same effect by
detecting reloaded values when spilling around copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:33 +00:00
Jakob Stoklund Olesen
dbc36091ff Intervals are half-open.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:29 +00:00
Jakob Stoklund Olesen
984a7fc32c When we find a reaching definition, make sure it is visited from all paths by
erasing it from the visited set. That ensures we create the right phi defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:36:28 +00:00
Jakob Stoklund Olesen
fc60d7729b Don't use nextIndex to check for live out of instruction.
Insert copy after defining instruction.

Fix LiveIntervalMap::extendTo to properly handle live segments starting before
the current basic block.

Make sure the open live range is extended to the inserted copy's use slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:36:25 +00:00
Jakob Stoklund Olesen
a818c072af Tweak VNInfo printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 18:48:57 +00:00
Jakob Stoklund Olesen
201ecfca98 Add assert for valid slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 18:48:55 +00:00
Owen Anderson
3a9e7690ba Use a more efficient lowering of uint64_t --> float that can take advantage of hardware signed integer conversion without
having to do a double cast (uint64_t --> double --> float).  This is based on the algorithm from compiler_rt's __floatundisf
for X86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 17:24:05 +00:00
Evan Cheng
2a135ae530 This DAG combine BRCOND transformation can look pass truncate of the operand:
//   %a = ...                                                                                                                                                                                  
    //   %b = and i32 %a, 2                                                                                                                                                                        
    //   %c = srl i32 %b, 1                                                                                                                                                                        
    //   brcond i32 %c ...                                                                                                                                                                         
    //                                                                                                                                                                                             
    // into                                                                                                                                                                                        
    //                                                                                                                                                                                             
    //   %a = ...                                                                                                                                                                                  
    //   %b = and i32 %a, 2                                                                                                                                                                        
    //   %c = setcc eq %b, 0                                                                                                                                                                       
    //   brcond %c ...

Make sure it restores local variable N1, which corresponds to the condition operand if it fails to match.

This apparently breaks TCE but since that backend isn't in the tree I don't have a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 22:41:01 +00:00
Lang Hames
ab62b7e861 Removed the older style (in-allocator) problem construction system from the PBQP allocator. Problem construction is now done exclusively with the new builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 12:13:07 +00:00
Jakob Stoklund Olesen
ed8263553a Stop using LiveRange in MachineVerifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 05:24:46 +00:00
Bob Wilson
f70007e89e Fix a miscompile in 186.crafty for Thumb2 that was exposed by Evan's
scheduling change in svn 115121.  The CriticalAntiDepBreaker had bad
liveness information.  It was calculating the KillIndices for one scheduling
region in a basic block, rescheduling that region so the KillIndices were
no longer valid, and then using those wrong KillIndices to make decisions
for the next scheduling region.  I've not been able to reduce a small
testcase for this.  Radar 8502534.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 01:49:29 +00:00
Jakob Stoklund Olesen
5f2d1fa0f7 Drop the use of LiveInterval::iterator and the LiveRange class in
RemoveCopyByCommutingDef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:27 +00:00
Jakob Stoklund Olesen
e0a73ec0a9 When RemoveCopyByCommutingDef is creating additional identity copies, just use
LiveInterval::MergeValueNumberInto instead of trying to extend LiveRanges and
getting it wrong.

This fixed PR8249 where a valno with a multi-segment live range was defined by
an identity copy created by RemoveCopyByCommutingDef. Some of the live
segments disappeared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:25 +00:00
Jakob Stoklund Olesen
a9b85c1074 Pretty up the debug output during RemoveCopyByCommutingDef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:22 +00:00
Devang Patel
21ea1d5b4c Add support to let FE mark explict methods as explict in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:31:40 +00:00
Jim Grosbach
2b2de24fe2 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:29:12 +00:00
Owen Anderson
e3cc84a43d Thread the determination of branch prediction hit rates back through the if-conversion heuristic APIs. For now,
stick with a constant estimate of 90% (branch predictors are good!), but we might find that we want to provide
more nuanced estimates in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 22:45:50 +00:00
Devang Patel
27f46cd639 Fix code gen crash reported in PR 8235. We still lose debug info for the unused argument here. This is a known limitation recorded debuginfo-tests/trunk/dbg-declare2.ll function 'f6' test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 19:00:44 +00:00
Gabor Greif
fb4032f422 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 10:32:19 +00:00
Chris Lattner
6bf263b4a2 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 06:54:02 +00:00
Chris Lattner
2831a19495 fix rdar://8494845 + PR8244 - a miscompile exposed by my patch in r101350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:36:09 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
Jakob Stoklund Olesen
2622f4622c When isel is emitting instructions for an x86 target without CMOV, the CFG is
edited during emission.

If the basic block ends in a switch that gets lowered to a jump table, any
phis at the default edge were getting updated wrong. The jump table data
structure keeps a pointer to the header blocks that wasn't getting updated
after the MBB is split.

This bug was exposed on 32-bit Linux when disabling critical edge splitting in
codegen prepare.

The fix is to uipdate stale MBB pointers whenever a block is split during
emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 19:44:31 +00:00
Devang Patel
3cf763dc7a Let FE mark a variable as artificial variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:07:21 +00:00
Evan Cheng
3881cb7a5d Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:42:35 +00:00
Benjamin Kramer
6406d004c9 Silence msvc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:38:50 +00:00
Devang Patel
1a30123b60 Add support to let FE encode method access specifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:44:16 +00:00
Owen Anderson
b0725316cd UnreachableBlockElim could incorrectly return false when it had not modified the CFG, but HAD modified some PHI nodes. Fixes PR8174.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 20:57:19 +00:00
Devang Patel
2a3616012c Assign DW_ACCESS_public accessibility attribute to members by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 19:08:08 +00:00
Bill Wendling
2ff6e1e62c Revert r114997. It was causing a failure on darwin10-selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:11:55 +00:00
Oscar Fuentes
3609eb0de2 Removed a bunch of unnecessary target_link_libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:39:14 +00:00
Bill Wendling
4edab1a9e8 Fix a FIXME. _foo.eh symbols are currently always exported so that the linker
knows about them. This is not necessary on 10.6 and later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:36:56 +00:00
Owen Anderson
7571ee7885 Give the if-converter access to MachineLoopInfo, and use it to generate plausible branch prediction
estimates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:42:15 +00:00
Owen Anderson
b20b85168c Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.

For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:32:13 +00:00
Devang Patel
1a7ca0354a Provide an interface to let FEs anchor debug info for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:08:20 +00:00
Devang Patel
ee70fa77b4 Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:15:27 +00:00
Dale Johannesen
61b20efd9a Don't try to make a vector of x86mmx; this won't work,
and asserts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 17:29:14 +00:00
Chris Lattner
8048ebe91d the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 06:44:54 +00:00
Lang Hames
cec2945f30 Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) overhead where possible. Thanks to Jakob for the suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-26 03:37:09 +00:00
Jakob Stoklund Olesen
207f8f688b Avoid using VNInfo::getCopy as much as possible. I want to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 18:10:38 +00:00
Lang Hames
6e2968c85c Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 12:04:16 +00:00
Jakob Stoklund Olesen
011e591071 Remove SlotIndex::PHI_BIT. It is no longer used by anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 00:45:18 +00:00
Jakob Stoklund Olesen
7c78e2624c Remove the only use of SlotIndex::isPHI. This bit is not being set consistently
and it will be removed shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 00:45:15 +00:00
Jakob Stoklund Olesen
1803b37bad Terminator gaps were unused. Might as well delete them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 23:58:56 +00:00
John Thompson
54584743f3 Fix for test/CodeGen/PowerPC/2008-10-17-AsmMatchingOperands.ll crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 22:24:05 +00:00
Michael J. Spencer
1f40960543 Get rid of pop_macro warnings on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 19:48:47 +00:00