[PATCH] D109052: [AMDGPU][GlobalISel] Fix waterfall loops

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 06:22:01 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:754
+      // If the mapping changed the control flow, look at the new successors.
+      for (auto *Suc : MBB->successors()) {
+        if (!OrigBlocks.count(Suc)) {
----------------
2 c's


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp:906
                               bool IsTailCall) {
-  return IsTailCall ? AMDGPU::SI_TCRETURN : AMDGPU::SI_CALL;
+  return IsTailCall ? AMDGPU::SI_TCRETURN : AMDGPU::G_SI_CALL;
 }
----------------
I think in the absence of knowing if the call target is uniform in CallLowering, we can't do tail calls


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:3142-3146
+    while (Start->getOpcode() != FrameSetupOpcode)
+      --Start;
+    MachineBasicBlock::iterator End(&MI);
+    while (End->getOpcode() != FrameDestroyOpcode)
+      ++End;
----------------
I'm not sure you can guarantee this is the range that needs to be moved. Could other instructions have been moved across these between the IRTranslator and here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109052



More information about the llvm-commits mailing list