[PATCH] D151285: [MC] Check if register is non-null before calling isSubRegisterEq (NFCI)
Sergei Barannikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 24 22:53:31 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGee1d5f637286: [MC] Check if register is non-null before calling isSubRegisterEq (NFCI) (authored by barannikov88).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151285/new/
https://reviews.llvm.org/D151285
Files:
bolt/lib/Core/MCPlusBuilder.cpp
llvm/lib/MC/MCInstrDesc.cpp
Index: llvm/lib/MC/MCInstrDesc.cpp
===================================================================
--- llvm/lib/MC/MCInstrDesc.cpp
+++ llvm/lib/MC/MCInstrDesc.cpp
@@ -40,7 +40,7 @@
bool MCInstrDesc::hasDefOfPhysReg(const MCInst &MI, unsigned Reg,
const MCRegisterInfo &RI) const {
for (int i = 0, e = NumDefs; i != e; ++i)
- if (MI.getOperand(i).isReg() &&
+ if (MI.getOperand(i).isReg() && MI.getOperand(i).getReg() &&
RI.isSubRegisterEq(Reg, MI.getOperand(i).getReg()))
return true;
if (variadicOpsAreDefs())
Index: bolt/lib/Core/MCPlusBuilder.cpp
===================================================================
--- bolt/lib/Core/MCPlusBuilder.cpp
+++ bolt/lib/Core/MCPlusBuilder.cpp
@@ -425,7 +425,7 @@
bool MCPlusBuilder::hasUseOfPhysReg(const MCInst &MI, unsigned Reg) const {
const MCInstrDesc &InstInfo = Info->get(MI.getOpcode());
for (int I = InstInfo.NumDefs; I < InstInfo.NumOperands; ++I)
- if (MI.getOperand(I).isReg() &&
+ if (MI.getOperand(I).isReg() && MI.getOperand(I).getReg() &&
RegInfo->isSubRegisterEq(Reg, MI.getOperand(I).getReg()))
return true;
for (MCPhysReg ImplicitUse : InstInfo.implicit_uses()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151285.525446.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230525/804c7c8d/attachment.bin>
More information about the llvm-commits
mailing list