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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 05:34:51 PST 2021


sdesmalen accepted this revision.
sdesmalen added a comment.
This revision is now accepted and ready to land.

That's a great change, which happens to make some of the tests a bit more readable. Thanks!



================
Comment at: llvm/lib/IR/ConstantFold.cpp:739
+
+    if (Elt->isZeroValue() && (!isa<ConstantFP>(Elt) ||
+                               cast<ConstantFP>(Elt)->isExactlyValue(+0.0))) {
----------------
nit: maybe add a comment to describe why it's testing specifically for +0.0? (I assume that is because zeroinitializer is positive)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113394



More information about the llvm-commits mailing list