[llvm] r352051 - [X86] Add missing isReg() guards in FixupSetCCs pass.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 24 07:04:17 PST 2019
Author: niravd
Date: Thu Jan 24 07:04:17 2019
New Revision: 352051
URL: http://llvm.org/viewvc/llvm-project?rev=352051&view=rev
Log:
[X86] Add missing isReg() guards in FixupSetCCs pass.
Modified:
llvm/trunk/lib/Target/X86/X86FixupSetCC.cpp
Modified: llvm/trunk/lib/Target/X86/X86FixupSetCC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FixupSetCC.cpp?rev=352051&r1=352050&r2=352051&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FixupSetCC.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FixupSetCC.cpp Thu Jan 24 07:04:17 2019
@@ -102,7 +102,7 @@ X86FixupSetCCPass::findFlagsImpDef(Machi
auto MBBStart = MBB->rend();
for (int i = 0; (i < SearchBound) && (MI != MBBStart); ++i, ++MI)
for (auto &Op : MI->implicit_operands())
- if ((Op.getReg() == X86::EFLAGS) && (Op.isDef()))
+ if (Op.isReg() && (Op.getReg() == X86::EFLAGS) && Op.isDef())
return &*MI;
return nullptr;
@@ -110,7 +110,7 @@ X86FixupSetCCPass::findFlagsImpDef(Machi
bool X86FixupSetCCPass::impUsesFlags(MachineInstr *MI) {
for (auto &Op : MI->implicit_operands())
- if ((Op.getReg() == X86::EFLAGS) && (Op.isUse()))
+ if (Op.isReg() && (Op.getReg() == X86::EFLAGS) && Op.isUse())
return true;
return false;
More information about the llvm-commits
mailing list