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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 09:07:21 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:334
+
+  auto HiAndLoHaveSameSrc = [&]() {
+    if (Register HiSrcReg = isLshrBy16(*HiMI))
----------------
It's a bit strange to define a lambda that is only used once.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:344-347
+    if (Register Reg = isLshrBy16(*HiMI)) {
+      MatchInfo = {MRI.getVRegDef(Reg), false};
+      return true;
+    }
----------------
What is this part for? It only seems to affect the specially constructed test cases in combine-or-and-shl.mir. Does it ever help with real code?


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

https://reviews.llvm.org/D118351



More information about the llvm-commits mailing list