[llvm] [CodeGen] MachineVerifier to check early-clobber constraint (PR #151421)
Abhay Kanhere via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 5 16:49:04 PDT 2025
================
@@ -584,6 +584,7 @@ bool AMDGPUInstructionSelector::selectG_AMDGPU_MAD_64_32(
I.setDesc(TII.get(Opc));
I.addOperand(*MF, MachineOperand::CreateImm(0));
I.addImplicitDefUseOperands(*MF);
+ I.getOperand(0).setIsEarlyClobber(true);
----------------
AbhayKanhere wrote:
Internally we discussed a variant for MI.setDesc(MCID, bool updateOpConstraint=false) that updates OperandConstraints if passed true, but setDesc is often part of a set of update operations and not the last so it is not always possible to update constraints there.
https://github.com/llvm/llvm-project/pull/151421
More information about the llvm-commits
mailing list