This is an archive of the discontinued LLVM Phabricator instance.

DAG: Relax foldBitcastedFPLogic conditions
ClosedPublic

Authored by arsenm on Jan 23 2023, 5:12 PM.

Details

Summary

Requiring a bitcast to exist was unhelpful. The most basic cases
are always going to be a CopyFromReg or load, so they would need
a new cast inserted. Don't require a bitcast if it's a free operation. I don't
think this logic makes particularly much sense (it seems to be imparting special
interpretation of bitcast), but this needs to be in sync with foldSignChangeInBitcast.

We should also get rid of this hasBitPreservingFPLogic hook. fabs/fneg
are bitpreserving or incorrectly implemented, so this should just be a
regular legality check.

Diff Detail

Event Timeline

arsenm created this revision.Jan 23 2023, 5:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 5:12 PM
arsenm requested review of this revision.Jan 23 2023, 5:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 5:12 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm planned changes to this revision.Jan 23 2023, 5:24 PM

Apparently 2 RISCV tests infinite loop on this

arsenm updated this revision to Diff 492154.Jan 25 2023, 9:34 AM
arsenm edited the summary of this revision. (Show Details)
RKSimon accepted this revision.Jan 25 2023, 10:10 AM

LGTM - and I agree that the dependence on the to/from bitcasts isn't great

This revision is now accepted and ready to land.Jan 25 2023, 10:10 AM