[llvm] [AMDGPU] Extend zero initialization of return values for TFE (PR #85759)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 04:27:06 PDT 2024


================
@@ -3321,6 +3325,29 @@ bool AMDGPUInstructionSelector::selectBufferLoadLds(MachineInstr &MI) const {
   return constrainSelectedInstRegOperands(*MIB, TII, TRI, RBI);
 }
 
+bool AMDGPUInstructionSelector::selectBufferLoadTfe(MachineInstr &MI) const {
+  // Get an iterator for the current MI
+  MachineBasicBlock *MBB = MI.getParent();
+  auto MII = MachineBasicBlock::iterator(MI);
+  MII = std::next(MII);
+
+  // Standard selection works fine, use that to generate the instruction
+  if (!selectImpl(MI, *CoverageInfo))
+    return false;
----------------
arsenm wrote:

This is pretty ugly and you're making assumptions about what the generated selector does. You don't have the equivalent handling in the DAG path? I assume this is done in the post-isel hook. FinalizeISel still runs the same EmitInstrWithCustomInserter, so the same code should work for both paths without this extra post-processing? 

https://github.com/llvm/llvm-project/pull/85759


More information about the llvm-commits mailing list