[PATCH] D103659: [AMDGPU][GlobalISel] Try to use op_sel when selecting packed instructions
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 4 04:06:43 PDT 2021
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:3341
+// register.
+static bool isHiElt(Register Src, Register &OutSrc,
+ const MachineRegisterInfo &MRI, bool &FNeg) {
----------------
Return OutSrc, or NoRegister on failure?
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:3359-3360
+
+ if (MI->getOpcode() != AMDGPU::G_TRUNC && MI->getOpcode() != AMDGPU::G_LSHR)
+ return false;
+
----------------
This seems redundant.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:3412
+// LoSrcOut and HiSrcOut.
+static bool isBuildVectorTrunc(MachineInstr *MI, Register &LoSrcOut,
+ Register &HiSrcOut,
----------------
Could return a std::pair of Registers, or {NoRegister,NoRegister} on failure. But I'm not sure if that would be cleaner.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:3416
+ // Strip G_BITCAST
+ Register Src = MI->getOperand(1).getReg();
+ MI = MRI.getVRegDef(Src);
----------------
Assert that we're looking at a G_BITCAST before doing this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103659/new/
https://reviews.llvm.org/D103659
More information about the llvm-commits
mailing list