[PATCH] D156346: CodeGen: Disable isCopyInstrImpl if there are implicit operands

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 05:47:41 PDT 2023


qcolombet added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetInstrInfo.h:1044
     if (MI.isCopy()) {
+      // TODO: Should validate implicit operands here?
       return DestSourcePair{MI.getOperand(0), MI.getOperand(1)};
----------------
Maybe that should be part of the verifier?


================
Comment at: llvm/include/llvm/CodeGen/TargetInstrInfo.h:1053
+    // instruction with an undef subregister def, and a full register
+    // implicit-def appended to the operand list.
+
----------------
Like I said in https://reviews.llvm.org/D156345, there was already a distinction between pure copies (`isCopy`) and copies with additional stuff that may require careful handling (`isCopyLike`).

Following this distinction, I feel that either:
- this is the right fix, or
- we need to make all the places that deals with isCopyInstr robust w.r.t. `isCopyLike` semantic, which may not be worth it to pull


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

https://reviews.llvm.org/D156346



More information about the llvm-commits mailing list