[PATCH] D83870: [ConstantFolding] check applicability of AllOnes constant creation first

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 21:05:38 PDT 2020


vtjnash marked an inline comment as done.
vtjnash added inline comments.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:346-347
+    if (C->isAllOnesValue() &&
+        (isa<IntegerType>(DestTy) || DestTy->isFloatingPointTy() ||
+         isa<VectorType>(DestTy)) &&
+        !DestTy->isX86_MMXTy() && !DestTy->isPtrOrPtrVectorTy())
----------------
nickdesaulniers wrote:
> The mix of `isa` and method calls is inconsistent.  How about we consistently use methods, rather than `isa`?
> 
> `Type::isIntegerTy`, `Type::isVectorTy` come to mind.
Works for me. I'd just followed getAllOnesValue, but agree this looks more consistent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83870





More information about the llvm-commits mailing list