[PATCH] D34029: Infer lowest bits of an integer Multiply when the low bits of the operands are known
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 17:28:31 PDT 2017
efriedma added inline comments.
================
Comment at: lib/Analysis/ValueTracking.cpp:377
+ unsigned ResultBitsKnown = std::min(TrailBitsKnown0 - TrailZero0,
+ TrailBitsKnown1 - TrailZero1);
+ // We know at least the trailing zeros, plus any other known bits
----------------
Reusing the name ResultBitsKnown is confusing.
================
Comment at: lib/Analysis/ValueTracking.cpp:380
+ // of the operands.
+ ResultBitsKnown = std::min(ResultBitsKnown + TrailZ, BitWidth);
+
----------------
These little comments aren't that useful for understanding the logic; needs one big paragraph explaining the logic for computing ResultBitsKnown.
https://reviews.llvm.org/D34029
More information about the llvm-commits
mailing list