[PATCH] D112064: [GlobalISel] Combine (build_vector_trunc x, undef) -> (bitcast x)
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 19 11:55:19 PDT 2021
arsenm added a comment.
Should add some MIR tests specifically for this in case we decide to stop using G_BUILD_VECTOR_TRUNC someday
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:630-637
- // (build_vector_trunc $src0, undef -> copy $src0
- MachineInstr *Src1Def = getDefIgnoringCopies(Src1, *MRI);
- if (Src1Def && Src1Def->getOpcode() == AMDGPU::G_IMPLICIT_DEF) {
- MI.setDesc(TII.get(AMDGPU::COPY));
- MI.RemoveOperand(2);
- return RBI.constrainGenericRegister(Dst, AMDGPU::SReg_32RegClass, *MRI) &&
- RBI.constrainGenericRegister(Src0, AMDGPU::SReg_32RegClass, *MRI);
----------------
I think deleting this should be split into a separate patch
================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-build-vector-trunc.v2s16.mir:157
; GFX9-LABEL: name: test_build_vector_trunc_s_v2s16_s_s32_s_undef_s32
; GFX9: liveins: $sgpr0
----------------
foad wrote:
> I could just remove all these "undef" test cases, since there is no longer any code in AMDGPUInstructionSelector that handles IMPLICIT_DEF specially.
Yes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112064/new/
https://reviews.llvm.org/D112064
More information about the llvm-commits
mailing list