This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Handle reducing FP values to nan
ClosedPublic

Authored by arsenm on Jun 9 2022, 1:57 PM.

Details

Summary

I'm not sure what the precedence of this should be compared to
replacing with zero/one/undef. Currently this will win out over the
others if it doesn't matter to the reduction. This has similar
advantages to undef.

Diff Detail

Event Timeline

arsenm created this revision.Jun 9 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 1:57 PM
arsenm requested review of this revision.Jun 9 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 1:57 PM
Herald added a subscriber: wdng. · View Herald Transcript

currently we prefer 0 over 1 over undef because having undef in reproducers makes the IR makes it more likely that the code has undefined behavior, causing future changes to potentially perturb optimized IR
I think we should prefer 0 over 1 over nan over undef

arsenm updated this revision to Diff 440314.Jun 27 2022, 10:55 AM

Prefer 0/1

aeubanks accepted this revision.Jun 27 2022, 10:58 AM
This revision is now accepted and ready to land.Jun 27 2022, 10:58 AM