[PATCH] D15815: [SLP] Truncate expressions to minimum required bit width

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 06:23:47 PST 2016


jmolloy requested changes to this revision.
jmolloy added a comment.
This revision now requires changes to proceed.

Hi Matt,

A couple of comments, but generally looks fine.

James


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3256
@@ +3255,3 @@
+
+  // If there are no external uses, there is nothing to do here.
+  if (ExternalUses.empty())
----------------
I'm not quite sure I understand why this is the case.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3299
@@ +3298,3 @@
+    auto &DL = F->getParent()->getDataLayout();
+    auto NumSignBits = ComputeNumSignBits(Scalar, DL, 0, AC, 0, DT);
+    auto NumTypeBits = IT->getBitWidth();
----------------
It feels like you should be able to benefit from DemandedBits here. That's what we do in the LoopVectorizer and it can trigger in many more situations than just ValueTracking.


http://reviews.llvm.org/D15815





More information about the llvm-commits mailing list