[PATCH] D158487: [PowerPC][altivec] Optimize codegen of vec_promote

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 01:54:59 PDT 2023


lkail added inline comments.


================
Comment at: clang/lib/Headers/altivec.h:14662
+  vector unsigned char __res =
+      __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1,
+                              -1, -1, -1, -1, -1, -1, -1, -1);
----------------
lkail wrote:
> qiucf wrote:
> > Could we just define it without initialization? This can also make undefined vector.
> Using `__builtin_shufflevector` generates poison values, which is stronger than `undef`, exposing more optimizations in my view. See https://llvm.org/docs/LangRef.html#id1781.
Also using `__builtin_shufflevector` is explicit, which has a formal specification https://clang.llvm.org/docs/LanguageExtensions.html#langext-builtin-shufflevector.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158487



More information about the cfe-commits mailing list