[llvm] [AMDGPU][True16][CodeGen] do not legalize t16 operand during user scan (PR #145450)
Joe Nash via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 24 08:35:33 PDT 2025
================
@@ -8716,6 +8716,8 @@ void SIInstrInfo::splitScalar64BitCountOp(SIInstrWorklist &Worklist,
void SIInstrInfo::addUsersToMoveToVALUWorklist(
Register DstReg, MachineRegisterInfo &MRI,
SIInstrWorklist &Worklist) const {
+ SmallVector<std::pair<MachineInstr *, unsigned>, 4> LegalizeList;
+
for (MachineRegisterInfo::use_iterator I = MRI.use_begin(DstReg),
----------------
Sisyph wrote:
I did not mean to rename LegalizeList.
I meant rewriting the loop to something like this
`for ( MachineOperand &MO : make_early_inc_range(MRI.use_begin(DstReg))
`
And then further changes to the loop to only insert unique MO.getparent() items into Worklist. Then you could avoid creating LegalizeList at all, and call legalizeOperandsVALUt16 directly in the else block where it was before.
But consider it a nit, the current approach is fine.
Please change the variable name back to LegalizeList if you keep it this way.
https://github.com/llvm/llvm-project/pull/145450
More information about the llvm-commits
mailing list