[PATCH] D11143: [RFC] Cross Block DSE
Karthik Bhat via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 03:37:10 PDT 2015
karthikthecool marked 2 inline comments as done.
karthikthecool added a comment.
Hi Daniel,Hal,
Thanks for the review. Please find my comments inline. I will try to upload the updated patch shortly.
Thanks and Regards
Karthik
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:101
@@ +100,3 @@
+ PDT = &getAnalysis<PostDominatorTree>();
+ if (PDT->getRootNode()) {
+ int Count = PDT->getRootNode()->getDFSNumOut();
----------------
dberlin wrote:
> Do you have a testcase for where PDT->getRootNode() is null?
>
> because that seems broken :)
>
Hi Daniel,
I found in the below case we were getting getRootNode as NULL so added the above check.
void foo() {
while(1);
}
================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:108
@@ +107,3 @@
+ // If we have more than 1 block try to populate candidate store.
+ if (Count > 1)
+ populateCandidateStores(F);
----------------
dberlin wrote:
> So, if we only have 1 block, why are you doing the rest of the work here, instead of returning false and exiting?
> :)
>
Updated code to executed FindFunctionBackedges and BackEdgesMap population only if Count > 1. I think we cannot return false here because we still need to do single block dse.
http://reviews.llvm.org/D11143
More information about the llvm-commits
mailing list