aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorLucas Prates <lucas.prates@arm.com>2020-03-05 16:45:03 +0000
committerLucas Prates <lucas.prates@arm.com>2020-03-19 12:07:23 +0000
commitf56550cf7f12b581a237b48a7f4d8b6682d45a09 (patch)
tree269bd60f0e56225b73e9040de90ee7059a0b842c /clang/lib/CodeGen/CodeGenFunction.h
parentd42711625af8188edb15c8ddad8c861fbca89c17 (diff)
downloadllvm-f56550cf7f12b581a237b48a7f4d8b6682d45a09.zip
llvm-f56550cf7f12b581a237b48a7f4d8b6682d45a09.tar.gz
llvm-f56550cf7f12b581a237b48a7f4d8b6682d45a09.tar.bz2
[ARM] Enabling range checks on Neon intrinsics' lane arguments
Summary: Range checks were not properly performed in the lane arguments of Neon intrinsics implemented based on splat operations. Calls to those intrinsics where translated to `__builtin__shufflevector` calls directly by the pre-processor through the arm_neon.h macros, missing the chance for the proper range checks. This patch enables the range check by introducing an auxiliary splat instruction in arm_neon.td, delaying the translation to shufflevector calls to CGBuiltin.cpp in clang after the checks were performed. Reviewers: jmolloy, t.p.northover, rsmith, olista01, ostannard Reviewed By: ostannard Subscribers: ostannard, dnsampaio, danielkiss, kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74619
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 440b088..0128a07 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3894,6 +3894,8 @@ public:
SmallVectorImpl<llvm::Value*> &O,
const char *name,
unsigned shift = 0, bool rightshift = false);
+ llvm::Value *EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx,
+ const llvm::ElementCount &Count);
llvm::Value *EmitNeonSplat(llvm::Value *V, llvm::Constant *Idx);
llvm::Value *EmitNeonShiftVector(llvm::Value *V, llvm::Type *Ty,
bool negateForRightShift);