- svdupq builtins that duplicate scalars to every quadword of a vector are defined using builtins for svld1rq (load and replicate quadword).
- svdupq builtins that duplicate boolean values to fill a predicate vector are defined using svcmpne.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Is there some reason you decided to implement these particular functions as inline functions directly in the header?
Earlier implementations of the ACLE had a lot more things done in the header file (such as the predication with zero/undef, immediate checks, etc). We've moved most of that to CGBuiltins. These macros were a bit specific and hadn't been moved to CGBuiltin yet, but are now kind of remnants of the old implementation. These are better expressed like the other builtins, so that we can further simplify the header file and maybe get rid of it entirely at some point. I've updated the patch accordingly.
clang/utils/TableGen/SveEmitter.cpp | ||
---|---|---|
98 | note: the changes to isScalarPredicate and to SVEType::str() are fixes to allow expressing bool, which weren't previously exhibited because there wasn't yet a builtin that used a scalar bool as argument. |
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
8054 | Please use something like CreateTempAlloca(llvm::ArrayType::get(EltTy, NumOpnds), CharUnits::fromQuantity(16)). (In particular, the way you've written it, the code allocates stack memory dynamically. Might want to add a test with some control flow to demonstrate that you're putting the alloca into the entry block.) | |
8058 | Builder.getInt64(). | |
clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_dupq.c | ||
258 | Please CHECK the alignment of all these operations. |
- Use CreateTempAlloca instead of CreateAlloca
- Added checks for alignment to the stores.
- Added test with control-flow to check the alloca is added to the entry-block.
clang/lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
8054 | Good shout, I didn't realise that. I've fixed that in the latest revision. |
Looks like this breaks check-clang on Windows:
http://45.33.8.238/win/14483/step_7.txt
And some other bots:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/37883/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Aacle_sve_dupq.c
http://lab.llvm.org:8011/builders/llvm-avr-linux/builds/993/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Aacle_sve_dupq.c
Please take a look, and revert for now if fixing takes a while.
I suspect some 'CHECK' lines should be CHECK-DAG lines, but I'll investigate that tomorrow. Thanks for pointing out!
Please use something like CreateTempAlloca(llvm::ArrayType::get(EltTy, NumOpnds), CharUnits::fromQuantity(16)).
(In particular, the way you've written it, the code allocates stack memory dynamically. Might want to add a test with some control flow to demonstrate that you're putting the alloca into the entry block.)