This is an archive of the discontinued LLVM Phabricator instance.

A readonly operand bundle should not prevent inference of readonly from a readnone callee
ClosedPublic

Authored by reames on Jan 18 2022, 11:17 AM.

Details

Summary

A readonly operand bundle disallows inference of readnone from the callee, but it should not prevent us from using the readnone fact on the callee to infer readonly for the callsite.

Fixes pr53270.

Review note: The change for writeonly is an unrelated bug fix, and I'll be landing it separately and rebasing. Included it here just because the cycle time on building changes to such a key header are painful.

Diff Detail

Event Timeline

reames created this revision.Jan 18 2022, 11:17 AM
reames requested review of this revision.Jan 18 2022, 11:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 11:17 AM
fhahn accepted this revision.Jan 18 2022, 12:18 PM

LGTM, thanks!

llvm/include/llvm/IR/InstrTypes.h
2291

nit: doc-comment should use ///?

2293

Nit: 2 spaces before This.

2294

nit: 2 spaces before The.

llvm/test/Transforms/InstCombine/trivial-dse-calls.ll
258

Do we also have a test with an unknown bundle?

This revision is now accepted and ready to land.Jan 18 2022, 12:18 PM
reames added inline comments.Jan 18 2022, 12:38 PM
llvm/include/llvm/IR/InstrTypes.h
2293

There appear to already be two? Did you maybe mean you wanted one? (At least from my memory of high school grammar, two is "correct".)

llvm/test/Transforms/InstCombine/trivial-dse-calls.ll
258

Should be covered by test/Features/OperandBundles/func-attrs.ll

fhahn added inline comments.Jan 18 2022, 12:40 PM
llvm/include/llvm/IR/InstrTypes.h
2293

Oh right, I can only speak from experience in other places in LLVM and it seems more often than not single spaces are used. Not a big deal though, I just thought it might have been a typo.

reames added inline comments.Jan 18 2022, 12:41 PM
llvm/include/llvm/IR/InstrTypes.h
2293

I think this is one of those where actual usage varies widely, and it doesn't really matter.

This revision was landed with ongoing or failed builds.Jan 18 2022, 12:56 PM
This revision was automatically updated to reflect the committed changes.