[PATCH] D75616: [AssumeBundles] Add API to query a bundles from a use

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 08:46:18 PST 2020


Tyker added inline comments.


================
Comment at: llvm/lib/IR/Instructions.cpp:387
 
+CallBase::BundleOpInfo &CallBase::getBundleOpInfoForOperand(unsigned OpIdx) {
+  if (bundle_op_info_end() - bundle_op_info_begin() < 8) {
----------------
jdoerfert wrote:
> Please explain this in a comment at the beginning of the function. Also comment the magic constants.
> Add text to asserts please.
added comments and messages to assets. hope its enough.



================
Comment at: llvm/lib/Transforms/Utils/KnowledgeRetention.cpp:291
+  return Result;
+}
+
----------------
jdoerfert wrote:
> Is this more for testing or do you expect another use case?
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.


================
Comment at: llvm/unittests/Transforms/Utils/KnowledgeRetentionTest.cpp:489
+  RunRandTest(9876789, 100000, -0, 7, 100);
+}
----------------
jdoerfert wrote:
> What is the runtime we are expecting here?
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75616/new/

https://reviews.llvm.org/D75616





More information about the llvm-commits mailing list