[PATCH] D59473: [ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 14:21:22 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4192-4194
+    KnownBits AddKnown(LHSKnown.getBitWidth());
+    computeKnownBitsFromAssume(
+        Add, AddKnown, /*Depth=*/0, Query(DL, AC, CxtI, DT, true));
----------------
What about this comment in `computeKnownBits()`:
```
  // computeKnownBitsFromAssume strictly refines Known.
  // Therefore, we run them after computeKnownBitsFromOperator.
```
By looking at `computeKnownBitsFromAssume()`, it doesn't look like that will affect the correctness of output,
the bits that weren't inferred from assumption will simply remain unknown, correct?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59473





More information about the llvm-commits mailing list