summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-02 14:56:12 +0000
committerDan Gohman <gohman@apple.com>2008-10-02 14:56:12 +0000
commitb158fd751c5e8957a8c60a48a4bf0af6f522b7c1 (patch)
treecd365d90a692ac7a731cad8e238246485958c6b0 /llvm/lib
parentb04e6edba910509975a2e09900a1ab38fd81299f (diff)
downloadbcm5719-llvm-b158fd751c5e8957a8c60a48a4bf0af6f522b7c1.tar.gz
bcm5719-llvm-b158fd751c5e8957a8c60a48a4bf0af6f522b7c1.zip
Work around an interaction between fast-isel and regalloc=local. The
local register allocator's physreg liveness doesn't recognize subregs, so it doesn't know that defs of %ecx that are immediately followed by uses of %cl aren't dead. This comes up due to the way fast-isel emits shift instructions. This is a temporary workaround. Arguably, local regalloc should handle subreg references correctly. On the other hand, perhaps fast-isel should use INSERT_SUBREG instead of just assigning to the most convenient super-register of %cl when lowering shifts. This fixes MultiSource/Benchmarks/MallocBench/espresso, MultiSource/Applications/hexxagon, and others, under -fast. llvm-svn: 56947
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 59500ad8b1b..3d5759001f0 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -741,7 +741,11 @@ bool X86FastISel::X86SelectShift(Instruction *I) {
if (Op1Reg == 0) return false;
TII.copyRegToReg(*MBB, MBB->end(), CReg, Op1Reg, RC, RC);
unsigned ResultReg = createResultReg(RC);
- BuildMI(MBB, TII.get(OpReg), ResultReg).addReg(Op0Reg);
+ BuildMI(MBB, TII.get(OpReg), ResultReg).addReg(Op0Reg)
+ // FIXME: The "Local" register allocator's physreg liveness doesn't
+ // recognize subregs. Adding the superreg of CL that's actually defined
+ // prevents it from being re-allocated for this instruction.
+ .addReg(CReg, false, true);
UpdateValueMap(I, ResultReg);
return true;
}
OpenPOWER on IntegriCloud