[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
Thu Feb 24 08:24:44 PST 2022
arsenm 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)
----------------
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
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118351/new/
https://reviews.llvm.org/D118351
More information about the llvm-commits
mailing list