[PATCH] D124889: [ValueTracking] Add support to deduce a PHI node being a power of 2 if each incoming value is a power of 2.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 01:41:11 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2058
+    }
+  }
+
----------------
Hm, I think that for recurrences, this context instruction adjustment is not necessary. I believe the reason why we need it in general for phis is that we might follow a backedge, in which case we will be working with values from a previous loop iterations. This can't happen when we're looking at Start, because it must dominate the whole loop.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2090
+  case Instruction::LShr:
+    return OrZero;
+  default:
----------------
Similar to the nowrap cases above, can't this (and div) use `OrZero || Q.IIQ.isExact(BO)`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124889



More information about the llvm-commits mailing list