This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Fix modifying a G_OR without notifying the observer
ClosedPublic

Authored by foad on Jan 29 2021, 7:12 AM.

Details

Summary

Remove the call to setFlags in favour of creating the instruction with
the correct flags in the first place, so we don't have to explicitly
notify the observer.

Diff Detail

Event Timeline

foad created this revision.Jan 29 2021, 7:12 AM
foad requested review of this revision.Jan 29 2021, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2021, 7:12 AM

No test case because I don't know how to test this in isolation. I found it when trying to enable CSE for the AMDGPU combiner passes, but there are still other problems that prevent that from working.

arsenm added inline comments.Jan 29 2021, 7:21 AM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
5502

There should be a buildOr

foad added inline comments.Jan 29 2021, 7:39 AM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
5502

There is a buildOr but it doesn't take Flags because it's very unusual to set fast math flags on a bitwise operation.

arsenm accepted this revision.Jan 29 2021, 7:47 AM
arsenm added inline comments.
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
5502

It should probaly just have the flags operand

This revision is now accepted and ready to land.Jan 29 2021, 7:47 AM
foad updated this revision to Diff 320144.Jan 29 2021, 8:25 AM

Change buildOr to take Flags.

arsenm accepted this revision.Jan 29 2021, 8:26 AM
This revision was landed with ongoing or failed builds.Jan 29 2021, 8:34 AM
This revision was automatically updated to reflect the committed changes.