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

Mateja Marjanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 24 08:25:34 PST 2022


matejam marked an inline comment as not done.
matejam added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp:322
+    if (MI.getOpcode() == TargetOpcode::G_LSHR) {
+      Register LshrCstReg = getDefIgnoringCopies(MI.getOperand(2).getReg(), MRI)
+                                ->getOperand(0)
----------------
arsenm wrote:
> matejam wrote:
> > arsenm wrote:
> > > Why use getDefIgnoringCopies instead of directly using mi_match?
> > In case we have a copy instruction as a second operand of G_LSHR. mi_match would return false, this way we don't have to worry about that.
> Extra copies should be separately folded out by copy combines
No, you were right, no need for getDefIgnoringCopies.


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

https://reviews.llvm.org/D118351



More information about the llvm-commits mailing list