[PATCH] D137388: [X86] Add necessary check isReg() when updating LiveVariables in convertToThreeAddress

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 05:12:27 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5bc36c8cb483: [X86] Add necessary check isReg() when updating LiveVariables in… (authored by yubing).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137388/new/

https://reviews.llvm.org/D137388

Files:
  llvm/lib/Target/X86/X86InstrInfo.cpp


Index: llvm/lib/Target/X86/X86InstrInfo.cpp
===================================================================
--- llvm/lib/Target/X86/X86InstrInfo.cpp
+++ llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -1768,7 +1768,7 @@
   if (LV) {  // Update live variables
     for (unsigned I = 0; I < NumRegOperands; ++I) {
       MachineOperand &Op = MI.getOperand(I);
-      if (Op.isDead() || Op.isKill())
+      if (Op.isReg() && (Op.isDead() || Op.isKill()))
         LV->replaceKillInstruction(Op.getReg(), MI, *NewMI);
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137388.474516.patch
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221110/bc094abb/attachment.bin>


More information about the llvm-commits mailing list