[PATCH] D113394: [IR] In ConstantFoldShuffleVectorInstruction use zeroinitializer for splats of 0

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 03:56:12 PST 2021


david-arm marked an inline comment as done.
david-arm added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:742
+    if (Elt->isZeroValue() && (!isa<ConstantFP>(Elt) ||
+                               cast<ConstantFP>(Elt)->isExactlyValue(+0.0))) {
+      auto *VTy = VectorType::get(EltTy, MaskEltCount);
----------------
nikic wrote:
> Shouldn't this just use `Elt->isNullValue()` instead of `Elt->isZeroValue()`?
That's a great suggestion @nikic, thanks!


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

https://reviews.llvm.org/D113394



More information about the llvm-commits mailing list