diff options
author | Jinsong Ji <jji@us.ibm.com> | 2019-09-04 14:01:47 +0000 |
---|---|---|
committer | Jinsong Ji <jji@us.ibm.com> | 2019-09-04 14:01:47 +0000 |
commit | 5309189d9b3e03f68fdd04b4372fc73ddc07f98e (patch) | |
tree | 561f8a503c9aaa0c088a6af1493fdfd249f8a7c6 /clang/lib/Sema/SemaChecking.cpp | |
parent | 791949afe56027404a4c0bc605f7e72cc272b41a (diff) | |
download | bcm5719-llvm-5309189d9b3e03f68fdd04b4372fc73ddc07f98e.tar.gz bcm5719-llvm-5309189d9b3e03f68fdd04b4372fc73ddc07f98e.zip |
[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
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index f6a705a70ac..bb06517ad51 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -3220,6 +3220,8 @@ bool Sema::CheckPPCBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { case PPC::BI__builtin_altivec_crypto_vshasigmad: return SemaBuiltinConstantArgRange(TheCall, 1, 0, 1) || SemaBuiltinConstantArgRange(TheCall, 2, 0, 15); + case PPC::BI__builtin_altivec_dss: + return SemaBuiltinConstantArgRange(TheCall, 0, 0, 3); case PPC::BI__builtin_tbegin: case PPC::BI__builtin_tend: i = 0; l = 0; u = 1; break; case PPC::BI__builtin_tsr: i = 0; l = 0; u = 7; break; |