[PATCH] D99276: [ValueTracking] peek through min/max to find isKnownToBeAPowerOfTwo

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 13:21:07 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:1738
     // it is the values returned by the select that are being compared.
-    Value *TrueVal = SI->getTrueValue();
-    Value *FalseVal = SI->getFalseValue();
-    Value *LHS = Cmp->getOperand(0);
-    Value *RHS = Cmp->getOperand(1);
+    auto *TrueVal = SI->getTrueValue();
+    auto *FalseVal = SI->getFalseValue();
----------------
spatel wrote:
> RKSimon wrote:
> > lebedev.ri wrote:
> > > Yeah, i think that's fine..
> > Really we should be avoiding auto for anything but casts or iterators
> So `const_cast` in the caller, or do you see another way to avoid the build errors?
if its calling build errors then by all means use auto


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

https://reviews.llvm.org/D99276



More information about the llvm-commits mailing list