This is an archive of the discontinued LLVM Phabricator instance.

[AssumeBundles] Add API to query a bundles from a use
ClosedPublic

Authored by Tyker on Mar 4 2020, 8:38 AM.

Details

Summary

Finding what information is know about a value from a use is generally useful and can be done quickly.

Diff Detail

Event Timeline

Tyker created this revision.Mar 4 2020, 8:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2020, 8:38 AM
jdoerfert added inline comments.Mar 4 2020, 7:50 PM
llvm/lib/IR/Instructions.cpp
387

Please explain this in a comment at the beginning of the function. Also comment the magic constants.
Add text to asserts please.

llvm/lib/Transforms/Utils/KnowledgeRetention.cpp
306

Is this more for testing or do you expect another use case?

llvm/unittests/Transforms/Utils/KnowledgeRetentionTest.cpp
489

What is the runtime we are expecting here?

Tyker updated this revision to Diff 248741.Mar 6 2020, 8:30 AM
Tyker marked 5 inline comments as done.

fixed formating in test
added comments as requested.

Tyker added inline comments.Mar 6 2020, 8:32 AM
llvm/lib/IR/Instructions.cpp
387

added comments and messages to assets. hope its enough.

llvm/lib/Transforms/Utils/KnowledgeRetention.cpp
306

there is another use case for getBundleOpInfoForOperand coming in D73404 in the implementation of Value::dropDroppableUses.

and i think that getKnowledgeFromOperandInAssume is a generally useful functionality especially with the getKnowledgeFromUseInAssume. you can gather all knowledge we have on a value by going through the use list.

llvm/unittests/Transforms/Utils/KnowledgeRetentionTest.cpp
489

On my computer the average for AssumeQueryAPI.getKnowledgeFromUseInAssume is around 116 ms
and without the large test the average is below 1ms.

do you think it is reasonable ? or the test should be reduced in size.

jdoerfert accepted this revision.Mar 6 2020, 9:21 AM

LGTM. One nit below.

llvm/include/llvm/Transforms/Utils/KnowledgeRetention.h
96

Can you add a short comment here as well please.

llvm/unittests/Transforms/Utils/KnowledgeRetentionTest.cpp
489

Should be fine.

This revision is now accepted and ready to land.Mar 6 2020, 9:21 AM
This revision was automatically updated to reflect the committed changes.