The patch D62993 : [PowerPC] Emit scalar min/max instructions with unsafe fp math has modified the functionality when Subtarget.hasP9Vector() && (!HasNoInfs || !HasNoNaNs), this modification is not expected.
For below case:
define double @test(double %a, double %b, double %c, double %d) { entry: %cmp = fcmp fast oeq double %a, %b %cond = select fast i1 %cmp, double %c, double %d ret double %cond }
Use the below command for pwr9 without the fast-math option,
llc -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names test.ll -o p9.s -mcpu=pwr9 -O3
we will get below assembly, this is not right, because we haven't used the fast-math option :
asm xssubdp f0, f1, f2 fsel f1, f0, f3, f4 xsnegdp f0, f0 fsel f1, f0, f1, f4 blr
But in fact, if without the patch D62993, above case we will get below assembly, this is the right:
# %bb.0: # %entry xscmpudp cr0, f1, f2 beq cr0, .LBB0_2 # %bb.1: # %entry fmr f3, f4 .LBB0_2: # %entry fmr f1, f3 blr