[PATCH] D68651: [InstCombine] Signed saturation patterns

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 11:54:26 PDT 2019


lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2053
+  if (A->getType()->getScalarType()->getIntegerBitWidth() > NewBitWidth ||
+      B->getType()->getScalarType()->getIntegerBitWidth() > NewBitWidth)
+    return nullptr;
----------------
nikic wrote:
> I'd use `Ty->getScalarSizeInBits()` rather than `Ty->getScalarType()->getIntegerBitWidth()` here and above. I believe that's idiomatic even if we're dealing specifically in integers.
Oh, thanks for spotting this, i thought i posted about this, but i guess it was in an inline comment that i deleted before posting.


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

https://reviews.llvm.org/D68651





More information about the llvm-commits mailing list