================
@@ -1281,26 +1277,67 @@ bool Compiler<Emitter>::VisitVectorBinOp(const 
BinaryOperator *E) {
   const Expr *LHS = E->getLHS();
   const Expr *RHS = E->getRHS();
   const auto *VecTy = E->getType()->getAs<VectorType>();
+  auto Op = E->isCompoundAssignmentOp()
+                ? BinaryOperator::getOpForCompoundAssignment(E->getOpcode())
+                : E->getOpcode();
 
   // The LHS and RHS of a comparison operator must have the same type. So we
   // just use LHS vector element type here.
   PrimType ElemT = this->classifyVectorElementType(LHS->getType());
   PrimType ResultElemT = this->classifyVectorElementType(E->getType());
 
-  // Evaluate LHS and save value to LHSOffset.
+  // Allocate a local pointer for LHS and RHS.
   unsigned LHSOffset = this->allocateLocalPrimitive(LHS, PT_Ptr, true, false);
+  unsigned RHSOffset = this->allocateLocalPrimitive(RHS, PT_Ptr, true, false);
+
+  // C++17 onwards require that we evaluate the RHS of the compound
+  // assignment op first.
----------------
yronglin wrote:

Yeah, I tried to remove this, and use the generic code path(evaluate LHS 
first), there are no test failures. Here just following what the current 
interpreter does. But seems it's unnecessary, should remove this?

https://github.com/llvm/llvm-project/pull/108949
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to