This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Remove isel patterns that start with (fneg (fma)).
Changes PlannedPublic

Authored by craig.topper on Sep 9 2021, 9:30 AM.

Details

Summary

(fneg (fma X, Y, Z)) is not equivalent to (fma (fneg X), Y, (fneg Z))
unless no signed zeros fast math flag is on.

See https://reviews.llvm.org/D90901 for a similar issue on X86.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 9 2021, 9:30 AM
craig.topper requested review of this revision.Sep 9 2021, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2021, 9:30 AM

Echoing the comment in D109525 - are there tests that include 'nsz' to confirm that we can still fold those patterns?
This is fixing a miscompile, so we might not want to hold it up on an optimization, but it would be nice to salvage the transform if possible.

llvm/test/CodeGen/ARM/fusedMAC.ll
16

Generate the full checks as a preliminary step, so we just see the diffs?

craig.topper planned changes to this revision.Oct 3 2021, 11:43 PM