[PowerPC][Altivec] Fix constant argument for vec_dss
authorJinsong Ji <jji@us.ibm.com>
Wed, 4 Sep 2019 14:01:47 +0000 (14:01 +0000)
committerJinsong Ji <jji@us.ibm.com>
Wed, 4 Sep 2019 14:01:47 +0000 (14:01 +0000)
commit5309189d9b3e03f68fdd04b4372fc73ddc07f98e
tree561f8a503c9aaa0c088a6af1493fdfd249f8a7c6
parent791949afe56027404a4c0bc605f7e72cc272b41a
[PowerPC][Altivec] Fix constant argument for vec_dss

Summary:
This is similar to vec_ct* in https://reviews.llvm.org/rL304205.

The argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

The fix is to turn the function into macros in altivec.h.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43072

Reviewers: nemanjai, hfinkel, #powerpc, wuzish

Reviewed By: #powerpc, wuzish

Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66699

llvm-svn: 370902
clang/include/clang/Basic/BuiltinsPPC.def
clang/lib/Headers/altivec.h
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/altivec-dss.c [new file with mode: 0644]
clang/test/CodeGen/builtins-ppc-error.c