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) {
13761376
13771377template <class Emitter >
13781378bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) {
1379+ const Expr *LHS = E->getLHS ();
1380+ const Expr *RHS = E->getRHS ();
13791381 assert (!E->isCommaOp () &&
13801382 " Comma op should be handled in VisitBinaryOperator" );
13811383 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 ;
13841390
13851391 // Prepare storage for result.
13861392 if (!Initializing && !E->isCompoundAssignmentOp () && !E->isAssignmentOp ()) {
@@ -1391,8 +1397,6 @@ bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) {
13911397 return false ;
13921398 }
13931399
1394- const Expr *LHS = E->getLHS ();
1395- const Expr *RHS = E->getRHS ();
13961400 const auto *VecTy = E->getType ()->getAs <VectorType>();
13971401 auto Op = E->isCompoundAssignmentOp ()
13981402 ? BinaryOperator::getOpForCompoundAssignment (E->getOpcode ())
Original file line number Diff line number Diff line change 66// RUN: -target-feature +neon \
77// RUN: -emit-llvm -w -O1 -o - %s | FileCheck --check-prefix=CHECK-AARCH64 %s
88
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+
917// REQUIRES: aarch64-registered-target || arm-registered-target
1018
1119// Test if int64_t and uint64_t can be correctly mangled.
You can’t perform that action at this time.
0 commit comments