[PATCH] D60504: NFC: Improve pattern matching in computeKnownBitsFromAssume.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 08:56:31 PDT 2019


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM

1. Re-run clang-format or manually check indentation; I marked a couple of lines that don't look right.
2. Since this code is still a potential perf problem, consider converting the chain of if-else to a switch on the compare predicate as a follow-up. [insert joke about using a good optimizing compiler... :) ]
3. This patch should not be titled with 'NFC' because it has external motivation/intent. "Improve compile-time performance in computeKnownBitsFromAssume" ?



================
Comment at: lib/Analysis/ValueTracking.cpp:821
+      if (match(Cmp, m_ICmp(Pred, m_V, m_Value(A))) &&
+                 isValidAssumeForContext(I, Q.CxtI, Q.DT)) {
+        KnownBits RHSKnown(BitWidth);
----------------
indentation looks wrong here


================
Comment at: lib/Analysis/ValueTracking.cpp:831
+      if (match(Cmp, m_ICmp(Pred, m_V, m_Value(A))) &&
+                 isValidAssumeForContext(I, Q.CxtI, Q.DT)) {
+        KnownBits RHSKnown(BitWidth);
----------------
indentation looks wrong here


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60504/new/

https://reviews.llvm.org/D60504





More information about the llvm-commits mailing list