[PATCH] D67941: Invalidate assumption cache before outlining.

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 15:25:36 PDT 2019


hiraditya marked an inline comment as done.
hiraditya added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:1377
+          if (match(&I, m_Intrinsic<Intrinsic::assume>()))
+            AC->unregisterAssumption(cast<CallInst>(&I));
+  }
----------------
vsk wrote:
> Is the findAffectedValues() operation inside of AssumptionCache not finding values because the llvm.assume is moved to another function? I.e. the search stops at an Argument? I think adding a unit test to CodeExtractorTest.cpp would really help.
Basically the assertion: `ValueTracking.cpp: 594     assert(I->getParent()->getParent() == Q.CxtI->getParent()->getParent() &&...` triggers because one of the values is not unregistered even after it was moved to a new function. The value which are moved to new function get successfully unregistered without this patch but the values which remained in the original function didnt. This is because pointers to values got updated and Assumption cache had stale pointers.

Let me try to add a test case to CodeExtractorTest.cpp, seems slightly tricky from the first glance.
 


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

https://reviews.llvm.org/D67941





More information about the llvm-commits mailing list