summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86InstrInfo.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-06-15 06:15:26 +0000
committerCraig Topper <craig.topper@intel.com>2018-06-15 06:15:26 +0000
commitc8a763ed84ba75f3513a7a4d3a119d96d143f7e6 (patch)
treea4473b3da86f019287070525a4e169b64c638fd5 /llvm/lib/Target/X86/X86InstrInfo.cpp
parent5ec210cc27e82f895eea150541b03a46494dbb03 (diff)
downloadbcm5719-llvm-c8a763ed84ba75f3513a7a4d3a119d96d143f7e6.tar.gz
bcm5719-llvm-c8a763ed84ba75f3513a7a4d3a119d96d143f7e6.zip
Revert r334802 "[X86] Prevent folding stack reloads with instructions that have an undefined register update."
There's a typo causing the build to fail. llvm-svn: 334803
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index c9af646e563..234de6ab703 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -8916,15 +8916,12 @@ static bool shouldPreventUndefRegUpdateMemFold(MachineFunction &MF, MachineInstr
if (MF.getFunction().optForSize() || !hasUndefRegUpdate(MI.getOpcode()) ||
!MI.getOperand(1).isReg())
return false;
-
- // Check if the register is explicitly marked as undef.
- if (MI.getOperand(1).isUndef())
- return true;
-
- // Another possibility is that it is defined by by an IMPLICIT_DEF pseudo.
+
MachineRegisterInfo &RegInfo = MF.getRegInfo();
MachineInstr *VRegDef = RegInfo.getUniqueVRegDef(MI.getOperand(1).getReg());
- return VRegDef && VRegDef->isImplicitDef()
+ if (VRegDef == nullptr)
+ return false;
+ return VRegDef->isImplicitDef();
}
OpenPOWER on IntegriCloud