The newly introduced API for checking whether poison comes solely from flags which can be dropped was out of sync. This was noticed by a reviewer post commit.
For the moment, disable the floating point flags. In a follow up change, I plan to add support in dropPoisonGeneratingFlags, but that deserves to be a change of it's own.
if (const auto *ExactOp = dyn_cast<PossiblyExactOperator>(Op))
if (ExactOp->isExact())
return true;
- if (const auto *FP = dyn_cast<FPMathOperator>(Op)) {
- auto FMF = FP->getFastMathFlags();
- if (FMF.noNaNs() || FMF.noInfs())
- return true;
- }
+ }
+
+ // TODO: this should really be under the ConsiderFlags block, but currently
+ // these are not dropped by dropPoisonGeneratingFlags
+ if (const auto *FP = dyn_cast<FPMathOperator>(Op)) {
+ auto FMF = FP->getFastMathFlags();
+ if (FMF.noNaNs() || FMF.noInfs())
+ return true;
}
unsigned Opcode = Op->getOpcode();
ret i8* %v1.fr
}
+
+define float @propagate_drop_fadd(float %arg) {
+; CHECK-LABEL: @propagate_drop_fadd(
+; CHECK-NEXT: [[V1:%.*]] = fadd ninf float [[ARG:%.*]], 2.000000e+00
+; CHECK-NEXT: [[V1_FR:%.*]] = freeze float [[V1]]
+; CHECK-NEXT: ret float [[V1_FR]]
+;
+ %v1 = fadd ninf float %arg, 2.0
+ %v1.fr = freeze float %v1
+ ret float %v1.fr
+}