From ISA, fcmpu will raise the Floating-Point Invalid Operation Exception (SNaN) if either of the operands is a Signaling NaN by setting the bit VXSNAN. But the instruction description didn't set the mayRaiseFPException which might have impact on the scheduling or some backend optimization.
Details
Details
- Reviewers
qiucf jsji ZhangKang - Group Reviewers
Restricted Project - Commits
- rG528554c39b09: [PowerPC] Set the mayRaiseFPException for FCMPUS/FCMPUD
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Can we add test to show the effect? Something like
%a = call double @llvm.experimental.constrained.fadd.f64(...) ; Insert the instruction here %b = call double @llvm.experimental.constrained.fdiv.f64(...)
I think instruction with side effect should prevent fdiv from scheduled upwards.
Comment Actions
define i32 @test(double %a, double %b) { entry: %r = fcmp ogt double %a, %b %g = zext i1 %r to i32 ret i32 %g }
Print MIR:
renamable $cr0 = FCMPUD killed renamable $f1, killed renamable $f2 # Without mayRaise set renamable $cr0 = nofpexcept FCMPUD killed renamable $f1, killed renamable $f2 # With mayRaise set
You can create a dedicated test file for fp-exception bit, so that we can re-check all fp-exception bits in instruction definitions.