[llvm] [AArch64][GlobalISel] Constrain G_CONSTANT_FOLD_BARRIER operand register classes (PR #177997)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 06:06:05 PST 2026
================
@@ -366,10 +366,11 @@ bool InstructionSelect::selectInstr(MachineInstr &MI) {
//
// Propagate that through to the source register.
const TargetRegisterClass *DstRC = MRI.getRegClassOrNull(DstReg);
- if (DstRC)
+ const TargetRegisterClass *SrcRC = MRI.getRegClassOrNull(SrcReg);
+ if (DstRC && SrcRC)
+ MRI.constrainRegClass(SrcReg, DstRC);
+ else if (DstRC)
MRI.setRegClass(SrcReg, DstRC);
----------------
arsenm wrote:
Probably doesn't work if the class wasn't set in the first place, maybe
`if (!SrcRC)
MRI.setRegClass(SrcReg, DstRC)
else
MRI.constrainRegClass
`
?
https://github.com/llvm/llvm-project/pull/177997
More information about the llvm-commits
mailing list