[InstCombine] Update predicate when canonicalizing comparisons in canonicalizeClampLike.
canonicalizeClampLike canonicalizes the ule/ugt comparisons to ult/uge, respectively. However, it does not update the variable holding the comparison predicate type after doing this. Later code fails to handle the non-canonical predicate type (specifically, the swap of ThresholdLowIncl and ThresholdHighExcl when Pred0 has been canonicalized from ugt to uge). This leads to the miscompile reported in PR53252. Fix this by updating the comparison predicate after canonicalizing. Fixes #53252 Differential Revision: https://reviews.llvm.org/D119690
Loading
Please sign in to comment