[PATCH] D148637: [LangRef] Update shufflevector's semantics to return poison if the mask is undef

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 00:42:39 PDT 2023


nikic added a comment.

I'm fine with the semantics change, but I think there are too many words here.



================
Comment at: llvm/docs/LangRef.rst:10026
+using ``undef`` for ``val`` is not recommended because it prohibits
+optimizations to '``shufflevector``' with ``poison`` masks.
+
----------------
I don't think this sentence really adds anything. It just introduces a new ill-defined term "don't-care vector".


================
Comment at: llvm/docs/LangRef.rst:10086-10101
+If the shuffle mask is ``poison``, the result vector is ``poison``. If
+the shuffle mask selects a ``poison`` element from one of the input vectors,
+the resulting element is ``poison``. Similarly, if an ``undef`` element
+is selected, the result is ``undef`` as well. A ``poison`` element
+in the mask vector specifies that the resulting element is ``poison``.
+
+If the shuffle mask is ``undef``, the result vector is ``poison``. An ``undef``
----------------
I feel like we could use a lot less words here and be less confusing at the same time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148637



More information about the llvm-commits mailing list