[PATCH] D29777: [Reassociate] Convert shl by constant into multiply during tree linearization.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 21 12:03:21 PST 2017
efriedma added a comment.
I'm not following why this fixes the crash. As far as I can tell, on trunk, Reassociate special-cases shl instructions in exactly one place: the check at the beginning of ReassociatePass::OptimizeInst. In that case, we replace all the uses of the shl instruction, so it shouldn't matter. (I'd like an answer to this to make sure you aren't papering over a real problem.)
================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:371
+ Shl->replaceAllUsesWith(Mul);
+ Mul->setDebugLoc(Shl->getDebugLoc());
+
----------------
Why don't we don't erase the dead Shl here?
https://reviews.llvm.org/D29777
More information about the llvm-commits
mailing list