[llvm] [SimpleLoopUnswitch] Don't latch-redirect trivial unswitch across convergent ops (PR #207047)
Ehsan Amiri via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 06:36:00 PDT 2026
================
@@ -3386,16 +3404,8 @@ static bool collectUnswitchCandidatesWithInjections(
static bool isSafeForNoNTrivialUnswitching(Loop &L, LoopInfo &LI) {
----------------
amehsan wrote:
> > Can you move this whole function up? I'm not really sure why you need to extract most of it to a separate function
>
> OK, if the check for tokens is necessary, then we should run this check on the loop upfront (In the beginning of unswitching). Can we limit this check to to targets that return true for `hasBranchDivergence()`?
Checking again: I think we only the first part of this function to run early (the part that deals with tokens and convergent ops). We don't need to worry about irreducible CFG in trivial unswitching.
https://github.com/llvm/llvm-project/pull/207047
More information about the llvm-commits
mailing list