This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Prevent tryToFoldBNEOnCmpXchgResult from deleting AND if has t others users.
ClosedPublic

Authored by craig.topper on Aug 27 2023, 10:01 PM.

Details

Summary

This disables the transform if the branch does not have the kill
flag set for the AND we want to delete.

Ideally we'd be able to share the AND with the AND we create in
the expansion, but that's a more complex transform. So this starts
with the simple approach to fix miscompile.

This should be backported to LLVM 17.

Fixes PR65025.ll

Diff Detail

Event Timeline

craig.topper created this revision.Aug 27 2023, 10:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2023, 10:01 PM
craig.topper requested review of this revision.Aug 27 2023, 10:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2023, 10:01 PM
asb accepted this revision.Aug 27 2023, 11:37 PM

LGTM, thanks.

This revision is now accepted and ready to land.Aug 27 2023, 11:37 PM
This revision was landed with ongoing or failed builds.Aug 28 2023, 10:11 AM
This revision was automatically updated to reflect the committed changes.
srhines added a subscriber: srhines.Sep 1 2023, 7:04 PM