[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 3 23:21:13 PDT 2022


yubing created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
yubing requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

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.473126.patch
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221104/f8dd36df/attachment.bin>


More information about the llvm-commits mailing list