[PATCH] D46340: AMDGPU/SI: Handle infinite loop for the structurizer to work with CFG with infinite loops.

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 09:28:33 PDT 2018


cfang marked 3 inline comments as done.
cfang added a comment.





================
Comment at: lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp:186-192
+          DummyReturnBB = BasicBlock::Create(F.getContext(),
+                                             "DummyReturnBlock", &F);
+          Type *RetTy = F.getReturnType();
+          Value *RetVal = RetTy->isVoidTy() ? nullptr : UndefValue::get(RetTy);
+          ReturnInst::Create(F.getContext(), RetVal, DummyReturnBB);
+          ReturningBlocks.push_back(DummyReturnBB);
+        }
----------------
nhaehnle wrote:
> The indentation looks wrong here. Please check with clang-format/clang-format-diff (I prefer to use clang-format-diff, because otherwise you're quite likely to get notifications about formatting errors in code that you didn't actually change).
Nice catch! Corrected. Thanks.


================
Comment at: lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp:199
+        BranchInst::Create(LoopHeaderBB, DummyReturnBB, BoolTrue, BB);
+      } else { // Comditional branch.
+        // Create a new transition block to hold the conditional branch.
----------------
nhaehnle wrote:
> Typo: *conditional
Thanks.


https://reviews.llvm.org/D46340





More information about the llvm-commits mailing list