[PATCH] D138044: AMDGPU/GlobalISel: Fix crash after mad/fma_mix fails selection

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 04:33:58 PST 2022


Pierre-vh added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp:4817
+    // to avoid creating dead copy instruction.
+    std::tie(Src, Mods) = selectVOP3ModsImpl(Root);
+    MachineInstr *MI = getDefIgnoringCopies(Src, *MRI);
----------------
With this it looks like we will end up calling `getVOP3ModsImpl` twice. I guess this isn't called often enough (and the "get" function seems simple enough) to cause performance issues but it still feels suboptimal
Could this be refactored to make it so selectVOP3ModsImpl doesn't need to call "get" again?
If not then I suppose it's fine as is



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

https://reviews.llvm.org/D138044



More information about the llvm-commits mailing list