[llvm] [SimplifyCFG] Fix uint32_t overflow in cbranch to cbranch merge prevention check. (PR #72329)
Valery Pykhtin via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 22:54:56 PST 2023
================
@@ -4351,10 +4351,10 @@ static bool SimplifyCondBranchToCondBranch(BranchInst *PBI, BranchInst *BI,
SmallVector<uint32_t, 2> PredWeights;
if (!PBI->getMetadata(LLVMContext::MD_unpredictable) &&
extractBranchWeights(*PBI, PredWeights) &&
- (PredWeights[0] + PredWeights[1]) != 0) {
+ ((uint64_t)PredWeights[0] + PredWeights[1]) != 0) {
----------------
vpykhtin wrote:
Done.
https://github.com/llvm/llvm-project/pull/72329
More information about the llvm-commits
mailing list