[PATCH] D85609: Transforms: add ConvergenceControlHeuristic pass
Anastasia Stulova via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 9 05:48:23 PDT 2021
Anastasia added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/ConvergenceControlHeuristic.cpp:15
+///
+/// 1. In acyclic code, refer to the nearest dominating convergence token if
+/// one exists.
----------------
Can I clarify what do you mean by `refer` here?
I presume if you only have IR with uncontrolled convergent operation there wouldn't be any tokens to find? Although perhaps this could apply if one has been inserted for another uncontrolled operation previously?
================
Comment at: llvm/lib/Transforms/Utils/ConvergenceControlHeuristic.cpp:17
+/// one exists.
+/// 2. Otherwise, refer to an `entry` intrinsic if the containing function
+/// is convergent, and to an `anchor` intrinsic otherwise.
----------------
Right now Clang decorates all function by convergent regardless whether or not they have convergent operations so it seems that if we are to generalize to the new behavior we could just append an entry intrinsic to the entry basic block everywhere?
================
Comment at: llvm/lib/Transforms/Utils/ConvergenceControlHeuristic.cpp:18
+/// 2. Otherwise, refer to an `entry` intrinsic if the containing function
+/// is convergent, and to an `anchor` intrinsic otherwise.
+/// 3. In natural loops, refer to a `loop` heart intrinsic in the loop header.
----------------
I would quite like to get an example of HL code that needs an anchor. I am not very clear where it fits at the moment.
================
Comment at: llvm/lib/Transforms/Utils/ConvergenceControlHeuristic.cpp:20
+/// 3. In natural loops, refer to a `loop` heart intrinsic in the loop header.
+/// 4. In irreducible cycles, place a heart intrinsic in one of the maximal
+/// dominating blocks inside the cycle, and anchor intrinsics in any others.
----------------
Ok, in the frontend we might have very limited information about the full CF structure while parsing.
Although we could also think of some combined approaches where frontend generates partial information and then the pass completes the rest...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85609/new/
https://reviews.llvm.org/D85609
More information about the llvm-commits
mailing list