topperc wrote: The RISCVInsertVSETVLI approach is probably just a matter of doing something like. May should check if an implicit def already exists before adding it. I don't think addOperand checks for duplicates.
``` diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp index 7433603daff8..2247610c21ff 100644 --- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp +++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp @@ -1531,6 +1531,13 @@ void RISCVInsertVSETVLI::emitVSETVLIs(MachineBasicBlock &MBB) { /*isImp*/ true)); } + if (MI.isInlineAsm()) { + MI.addOperand(MachineOperand::CreateReg(RISCV::VL, /*isDef*/ true, + /*isImp*/ true)); + MI.addOperand(MachineOperand::CreateReg(RISCV::VTYPE, /*isDef*/ true, + /*isImp*/ true)); + } + if (MI.isCall() || MI.isInlineAsm() || MI.modifiesRegister(RISCV::VL, /*TRI=*/nullptr) || MI.modifiesRegister(RISCV::VTYPE, /*TRI=*/nullptr)) ``` https://github.com/llvm/llvm-project/pull/128636 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits