We can still get a NaN even if none of the operands are NaN,
e.g. from +inf/-inf. D50804 didn't catch that.
Details
- Reviewers
arsenm foad - Commits
- rG3ec0085c3fd4: [DAG] Update `isKnownNeverNaN` for `FMA/FMAD`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Code change looks good. Is it possible to add a test as described in https://reviews.llvm.org/D50804#1202429?
Do you mean we need the same test but in AMDGPU, or does the test need to be changed as well?
The test added in D50804 was for fadd and fmul. I'm suggesting you could extend it now to cover fma and fmad as well.
I did some tries but I can't get a DAG combine to involve FMA/FMAD in DAGISel that's affected by this change (I tried both on AArch64 and AMDGPU). Any idea of how I can write such a test and what the expected output should be?
The only combine I found involving this function only works if -enable-no-signed-zeros-fp-math is used
Then use "no-signed-zeros-fp-math"="true" in the test. That combine should also be updated to use nsz flags