-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmiscompilation
Description
Test Transforms/InstCombine/fabs.ll shows the following transformation:
define double @select_fcmp_ole_zero(double %x) {
%lezero = fcmp ole double %x, 0.000000
%negx = fsub double 0.000000, %x, exceptions=ignore
%fabs = select i1 %lezero, double %negx, double %x
ret double %fabs
}
=>
define double @select_fcmp_ole_zero(double %x) {
%1 = fabs double %x, exceptions=ignore
ret double %1
}This is not correct as fabs produces a non-deterministic NaN payload, while the original function preserved the NaN payload when x > 0.
Metadata
Metadata
Assignees
Labels
llvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmiscompilation