[PATCH] D123071: Power of 2 ValueTracking for PHI node

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 14:59:57 PDT 2022


davidxl added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2028
+static bool isPowerOfTwoRecurrence(const PHINode *PN, bool OrZero,
+                                   unsigned Depth, Query &Q)
+{
----------------
run a clang-format on the changed part.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2045
+
+  // Except for Mul, the induciton variable must be on the left side of the
+  // increment expression, otherwise its value can be arbitrary.
----------------
typo: induction


================
Comment at: llvm/test/Analysis/ValueTracking/known-power-of-two-urem.ll:26
+
+define i64 @knwon_power_of_two_urem_phi(i64 %size, i1 %cmp, i1 %cmp1) {
+; CHECK-LABEL: @knwon_power_of_two_urem_phi(
----------------
Please also add tests for 

1) other operators for simple recurrence.

2) for other type of recurrence (change at line 2177).  

3) chained phi case

4) negative cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123071



More information about the llvm-commits mailing list