[PATCH] D46912: StructurizeCFG: Adjust the loop depth for a subregion to order the nodes correctly

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 13:32:13 PDT 2018


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

Right. Reverse Post Order (RPO) should be the fundamental order. But apparently there are some cases that pure RPO does not work.
That's the reason loop depth was introduced to guard the ordering of the nodes.

While the logic behind the loop depth based RPO ordering is still not clear to me, this patch is enhancing that approach.
A subregion should be collapsed into one special node and the loop in the subregion is not appropriate to be used for the ordering.



================
Comment at: test/Transforms/StructurizeCFG/AMDGPU/loop-subregion-misordered.ll:1
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -structurizecfg %s | FileCheck %s
+;
----------------
arsenm wrote:
> Did you use update_test_checks for this? The comment is missing
Did update_test_checks and comment shows now. 


================
Comment at: test/Transforms/StructurizeCFG/AMDGPU/loop-subregion-misordered.ll:175-177
+; The same function, except break to return block goes directly to the
+; return, which managed to hide the bug.
+; FIXME: Merge variant from backedge-id-bug-xfail
----------------
arsenm wrote:
> Does this comment still apply?
This comment is no longer needed! Removed. Thanks.


https://reviews.llvm.org/D46912





More information about the llvm-commits mailing list