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

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 00:45:59 PDT 2018


nhaehnle added a comment.

Thanks. This change introduces more branches, but since it should only do so in an infinite loop it should be fine.

I did notice some minor style problems though.



================
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);
+        }
----------------
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).


================
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.
----------------
Typo: *conditional


https://reviews.llvm.org/D46340





More information about the llvm-commits mailing list