Skip to content

Commit a1b6a34

Browse files
eternastudentoigcbot
authored andcommitted
Fix incorrectly chosen Atomic Branch predicate when several modes are enabled
In case both umin and umax Atomic Branch modes are enabled, predication should be done based on an actual atomic processed, not on a mode enabled.
1 parent 6ca4e41 commit a1b6a34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7423,7 +7423,7 @@ void InsertBranchOpt::atomicSplitOpt(Function& F, int mode)
74237423
// if (src > (for UMax) or < (for Umin) x)
74247424
// use the original atomic umax/umin inst src
74257425
readI = createReadFromAtomic( builder, inst, isTyped );
7426-
CmpInst::Predicate predicate = umaxMode ? ICmpInst::ICMP_UGT : ICmpInst::ICMP_ULT;
7426+
CmpInst::Predicate predicate = ( op == AtomicOp::EATOMIC_UMAX ) ? ICmpInst::ICMP_UGT : ICmpInst::ICMP_ULT;
74277427
Instruction* condInst = dyn_cast<Instruction>( builder.CreateICmp( predicate, src, readI ) );
74287428

74297429
splitBBAndName( condInst, inst, &ThenTerm, nullptr, MergeBlock );

0 commit comments

Comments
 (0)