[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:19:50 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. Can we limit this check to to targets that return true for `hasBranchDivergence()`?

https://github.com/llvm/llvm-project/pull/207047


More information about the llvm-commits mailing list