AssumptionCache can be null in SimplifyCFGOptions. However, FoldCondBranchOnPHI() was not properly handling that when passing a null AssumptionCache to simplifyCFG.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM with a few small suggestions. Please wait a bit with committing in case there are additional comments.
llvm/lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
2272 | While you are at it, it might be worth simplifying the condition to something like if (AC && match(N, m_Intrinsic<IntrinsicInst::assume>()) | |
llvm/unittests/Transforms/Utils/LocalTest.cpp | ||
989 | might be worth stating that this is just to get a pointer to %test.bb. You could also just check the BB name, which is slightly more direct. Also, it would be good to assert that we found TestBB. | |
996 | nit: you could just use EXPECT_TRUE directly, I do not think the variable adds much. |
Addressed comments.
Thanks everyone for the review.
Can someone please commit this patch for me?
Thanks, I'll land the patch
llvm/lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
2271 | This is not required the using match as below. I'll update it before committing |
llvm/lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
2273 | if (AC && N && match(N, m_Intrinsic<Intrinsic::assume>())) ? |
This is not required the using match as below. I'll update it before committing