[clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

Orlando Cazalet-Hyams via cfe-commits cfe-commits at lists.llvm.org
Fri May 23 06:30:20 PDT 2025


================
@@ -1242,9 +1242,17 @@ void CodeGenFunction::EmitDoStmt(const DoStmt &S,
   // As long as the condition is true, iterate the loop.
   if (EmitBoolCondBranch) {
     uint64_t BackedgeCount = getProfileCount(S.getBody()) - ParentCount;
-    Builder.CreateCondBr(
+    auto *I = Builder.CreateCondBr(
         BoolCondVal, LoopBody, LoopExit.getBlock(),
         createProfileWeightsForLoop(S.getCond(), BackedgeCount));
+
+    // Key Instructions: Emit the condition and branch as separate atoms to
+    // match existing loop stepping behaviour. FIXME: We could have the branch
----------------
OCHyams wrote:

Done.

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


More information about the cfe-commits mailing list