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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 09:31:19 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/X86/X86InstrInfo.cpp:1772
+      if (Op.isReg() && (Op.isDead() || Op.isKill()))
         LV->replaceKillInstruction(Op.getReg(), MI, *NewMI);
     }
----------------
RKSimon wrote:
> By inspection - the getReg below will assert if its isn't a register so this should be OK.
> 
> @foad might have a suggestion regarding alternative ways to test though? 
The instruction that @yubing cited in D136596 was: `%22:vr512 = VPBROADCASTDZrmk %21:vr512(tied-def 0), killed %20:vk16wm, %stack.1, 1, $noreg, 0, $noreg :: (load (s32) from %stack.1, align 64)`

So I guess maybe any of these `*rmk` instructions handled at line 1690 could have an operand that is %stack.n instead of a register?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137388



More information about the llvm-commits mailing list