[llvm] [NFC][SimplifyCFG] Simplify operators for the combined predicate in `mergeConditionalStoreToAddress` (PR #155058)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 13:22:58 PDT 2025


================
@@ -4404,10 +4404,12 @@ static bool mergeConditionalStoreToAddress(
 
   // OK, we're going to sink the stores to PostBB. The store has to be
   // conditional though, so first create the predicate.
-  Value *PCond = cast<BranchInst>(PFB->getSinglePredecessor()->getTerminator())
-                     ->getCondition();
-  Value *QCond = cast<BranchInst>(QFB->getSinglePredecessor()->getTerminator())
-                     ->getCondition();
+  BranchInst *const PBranch =
+      cast<BranchInst>(PFB->getSinglePredecessor()->getTerminator());
+  BranchInst *const QBranch =
----------------
nikic wrote:

Do not use const qualified locals. (Only qualify pointers.)

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


More information about the llvm-commits mailing list