[llvm] [InstCombine] Fix miscompilation for `select` + `FCmp` (PR #177872)
Tirthankar Mazumder via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 08:58:35 PST 2026
================
@@ -4303,16 +4302,29 @@ Instruction *InstCombinerImpl::visitSelectInst(SelectInst &SI) {
// (X ugt Y) ? X : Y -> (X ole Y) ? Y : X
if (FCmp->hasOneUse() && FCmpInst::isUnordered(Pred)) {
FCmpInst::Predicate InvPred = FCmp->getInversePredicate();
- Value *NewCond = Builder.CreateFCmpFMF(InvPred, Cmp0, Cmp1, FCmp,
+ // Intersect fast-math flags from the original fcmp and select.
----------------
wermos wrote:
I've removed this part.
https://github.com/llvm/llvm-project/pull/177872
More information about the llvm-commits
mailing list