File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1376,11 +1376,17 @@ bool Compiler<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
1376
1376
1377
1377
template <class Emitter >
1378
1378
bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) {
1379
+ const Expr *LHS = E->getLHS ();
1380
+ const Expr *RHS = E->getRHS ();
1379
1381
assert (!E->isCommaOp () &&
1380
1382
" Comma op should be handled in VisitBinaryOperator" );
1381
1383
assert (E->getType ()->isVectorType ());
1382
- assert (E->getLHS ()->getType ()->isVectorType ());
1383
- assert (E->getRHS ()->getType ()->isVectorType ());
1384
+ assert (LHS->getType ()->isVectorType ());
1385
+ assert (RHS->getType ()->isVectorType ());
1386
+
1387
+ // We can only handle vectors with primitive element types.
1388
+ if (!canClassify (LHS->getType ()->castAs <VectorType>()->getElementType ()))
1389
+ return false ;
1384
1390
1385
1391
// Prepare storage for result.
1386
1392
if (!Initializing && !E->isCompoundAssignmentOp () && !E->isAssignmentOp ()) {
@@ -1391,8 +1397,6 @@ bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) {
1391
1397
return false ;
1392
1398
}
1393
1399
1394
- const Expr *LHS = E->getLHS ();
1395
- const Expr *RHS = E->getRHS ();
1396
1400
const auto *VecTy = E->getType ()->getAs <VectorType>();
1397
1401
auto Op = E->isCompoundAssignmentOp ()
1398
1402
? BinaryOperator::getOpForCompoundAssignment (E->getOpcode ())
Original file line number Diff line number Diff line change 6
6
// RUN: -target-feature +neon \
7
7
// RUN: -emit-llvm -w -O1 -o - %s | FileCheck --check-prefix=CHECK-AARCH64 %s
8
8
9
+ // RUN: %clang_cc1 -triple arm-linux-guneabi \
10
+ // RUN: -target-cpu cortex-a8 -fexperimental-new-constant-interpreter \
11
+ // RUN: -emit-llvm -w -O1 -o - %s | FileCheck --check-prefix=CHECK-ARM %s
12
+
13
+ // RUN: %clang_cc1 -triple arm64-linux-gnueabi \
14
+ // RUN: -target-feature +neon -fexperimental-new-constant-interpreter \
15
+ // RUN: -emit-llvm -w -O1 -o - %s | FileCheck --check-prefix=CHECK-AARCH64 %s
16
+
9
17
// REQUIRES: aarch64-registered-target || arm-registered-target
10
18
11
19
// Test if int64_t and uint64_t can be correctly mangled.
You can’t perform that action at this time.
0 commit comments