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

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 13:56:08 PDT 2020


nickdesaulniers 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())
----------------
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.


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