[PATCH] D137407: [GlobalIsel] Handle carry output generated in narrowScalarAddSub legalize action

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 10:05:53 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:5128-5131
+  const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
+  for (MachineInstr &Use : MRI.use_instructions(CarryDst)) {
+    Use.substituteRegister(CarryDst, CarryIn, 0, *TRI);
+  }
----------------
Changing the uses from here isn't the way the legalizer expects to work. Each instruction is legalized on its own without modifying other instructions, and using intermediate cast operations. The artifact combiner is then responsible for cleaning out illegal intermediate types 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137407



More information about the llvm-commits mailing list