summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-05-18 16:10:17 +0000
committerHans Wennborg <hans@hanshq.net>2016-05-18 16:10:17 +0000
commit8eb336c14e4c033a3f81a3a43fe397f0879a2e68 (patch)
treee85fba6e6e6ed0c2528c0c565c6fea53085520d6 /llvm/lib/CodeGen/RegAllocFast.cpp
parent9430b9113a54eafaa9bd7d7bb288c7a457d26404 (diff)
downloadbcm5719-llvm-8eb336c14e4c033a3f81a3a43fe397f0879a2e68.tar.gz
bcm5719-llvm-8eb336c14e4c033a3f81a3a43fe397f0879a2e68.zip
Re-commit r269828 "X86: Avoid using _chkstk when lowering WIN_ALLOCA instructions"
with an additional fix to make RegAllocFast ignore undef physreg uses. It would previously get confused about the "push %eax" instruction's use of eax. That method for adjusting the stack pointer is used in X86FrameLowering::emitSPUpdate as well, but since that runs after register-allocation, we didn't run into the RegAllocFast issue before. llvm-svn: 269949
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocFast.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index d18ecf91ea4..83b59bae838 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -349,6 +349,11 @@ void RAFast::usePhysReg(MachineOperand &MO) {
unsigned PhysReg = MO.getReg();
assert(TargetRegisterInfo::isPhysicalRegister(PhysReg) &&
"Bad usePhysReg operand");
+
+ // Ignore undef uses.
+ if (MO.isUndef())
+ return;
+
markRegUsedInInstr(PhysReg);
switch (PhysRegState[PhysReg]) {
case regDisabled:
OpenPOWER on IntegriCloud