[PATCH] D103861: [Attributor] Look through selects in genericValueTraversal

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 17:43:03 PDT 2021


baziotis added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:309
+      if (!C.hasValue() || isa_and_nonnull<UndefValue>(*C))
+        continue;
+      if (auto *CI = dyn_cast_or_null<ConstantInt>(*C)) {
----------------
kuter wrote:
> `A.getAssumedConstant` returns None if the value simplification wasn't possible. 
> If the value is simplified but not constant it returns nullptr.
> 
> Shouldn't we visit the true and false options when there is no simplification ? 
> I don't understand why we `continue` here. I think callback  would receive the select instruction itself.
> Which is very different from previous behavior.
Well, it's an intricate design but now it's clear, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103861



More information about the llvm-commits mailing list