[PATCH] D20957: [JumpThreading] Prevent dangling pointer problems in BranchProbabilityInfo

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 09:07:21 PDT 2016


igor-laevsky added a comment.

In http://reviews.llvm.org/D20957#454115, @dnovillo wrote:

> I agree with Igor's analysis.  Let's first fix the correctness issue.  Any compile-time problems that show up, can be fixed with a data structure change later.  Igor, do you have any test cases that show the problem?  Without a test case, it's harder to justify this change.
>
> Thanks.  Diego.


Hi,

Noticeable effect of this failure appears only if new BasicBlock was allocated at the same place as the removed one. It will depend on many things which are impossible to guarantee for a single test case. I've added test which will fail AssertingVH in case if BasicBlock was not removed. Should be enough to guarantee that no one forgets to call eraseBlock in the future.


http://reviews.llvm.org/D20957





More information about the llvm-commits mailing list