[PATCH] D73832: Ignore/Drop droppable uses for code-sinking in InstCombine

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 12:24:03 PST 2020


Tyker marked 2 inline comments as done.
Tyker added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/KnowledgeRetention.cpp:263
+      Assume.bundle_op_infos(), [&Assume](const CallBase::BundleOpInfo &BOI) {
+        return BOI.Begin == BOI.End ||
+               getValueFromBundleOpInfo(Assume, BOI, BOIE_WasOn) != nullptr;
----------------
jdoerfert wrote:
> We do we disallow empty BundleOpInfo here?
i am not sure i understood the question.

we will return true for empty bundles.

this is a simple utility to check if the operand bundle of an llvm.assume still holds any information. it is used in a few places because instcombine was removing instructions like `call void @llvm.assume(i1 true) ["nonnull"(%p)]` because the argument to the call is known to be true so the assume was considered useless which is not true anymore.




================
Comment at: llvm/test/Transforms/InstCombine/assume.ll:274
 ; CHECK:       taken:
-; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32* [[LOAD]], null
 ; CHECK-NEXT:    tail call void @llvm.assume(i1 [[CMP]])
----------------
jdoerfert wrote:
> Why don't we sink this one anymore?
in this case there is a single use which is droppable (in an llvm.assume). so hasOneUse return true, but getSingleUndroppableUse returns null. so the old passe will sink the instruction whereas the new won't.

this doesn't matter however because this instruction is only used in an @llvm.assume so it is already dead and the backend will it cleanup.


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

https://reviews.llvm.org/D73832





More information about the llvm-commits mailing list