[PATCH] D38313: [InstCombine] Introducing Aggressive Instruction Combine pass

Amjad Aboud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 10:50:31 PDT 2017


aaboud marked 4 inline comments as done.
aaboud added a comment.

Thanks Hal for the review.
I will update the patch with the changes you ask for.
Also, see one answer below.



================
Comment at: lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp:157
+  InstInfoMap.clear();
+  if (!buildTruncExpressionDag(Src, 0))
+    return nullptr;
----------------
hfinkel wrote:
> If we have a DAG of instructions with multiple trunc outputs, we'll end up walking the DAG once per trunc output?
That is is correct, and we will not be able to perform the transformation for any of these trunc instructions.
This means that the complexity of this pass is at most O(n^2), in the worst case where n/2 is the DAG nodes and n/2 are trunc instructions that are using/truncating the DAG result.

Should we worry about this case? Can we solve it?


https://reviews.llvm.org/D38313





More information about the llvm-commits mailing list