[PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*
authorJinsong Ji <jji@us.ibm.com>
Wed, 4 Sep 2019 15:22:26 +0000 (15:22 +0000)
committerJinsong Ji <jji@us.ibm.com>
Wed, 4 Sep 2019 15:22:26 +0000 (15:22 +0000)
commita71c199f82cd3309dd9a1a18d01c28437e672fe3
treeb244d6e772ec5012153b319d04ba892b35c96d0b
parent4a2cd7be5a6fbca1be111ad56927e0dfc3185f88
[PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*

Summary:
This is follow up of https://reviews.llvm.org/D66699.
We might get ISEL ICE if we call vec_dss with non const 3rd arg.

```
Cannot select: intrinsic %llvm.ppc.altivec.dst
```

We should check the constraints in clang and generate better error
messages.

Reviewers: nemanjai, hfinkel, echristo, #powerpc, wuzish

Reviewed By: #powerpc, wuzish

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

Tags: #clang

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

llvm-svn: 370912
clang/include/clang/Basic/BuiltinsPPC.def
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-ppc-error.c