[PATCH] D118351: [AMDGPU][GlobalISel] Code quality: don't expand G_BUILD_VECTOR_TRUNC if not neccessary

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 14:09:39 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:310-312
+  if (FCanonOpMI->getOpcode() == TargetOpcode::G_BITCAST)
+    TmpReg = FCanonOpMI->getOperand(1).getReg();
+  return TLI->isCanonicalized(TmpReg, MF);
----------------
What's the point of this change? I don't think this is really correct since a bitcast from <2 x s16> to s32 won't have a consistent canonicalized interpretation


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:356
+      return true;
+    } else {
+      MatchInfo = {HiMI, true};
----------------
No else after return


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:405
+
+  MI.eraseFromParent();
 }
----------------
Missing return value


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

https://reviews.llvm.org/D118351



More information about the llvm-commits mailing list