================ @@ -5312,6 +5314,149 @@ bool Compiler<Emitter>::VisitComplexUnaryOperator(const UnaryOperator *E) { return true; } +template <class Emitter> +bool Compiler<Emitter>::VisitVectorUnaryOp(const UnaryOperator *E) { + const Expr *SubExpr = E->getSubExpr(); + assert(SubExpr->getType()->isVectorType()); + + if (DiscardResult) + return this->discard(SubExpr); + + std::optional<PrimType> ResT = classify(E); + auto prepareResult = [=]() -> bool { + if (!ResT && !Initializing) { + std::optional<unsigned> LocalIndex = allocateLocal(SubExpr); + if (!LocalIndex) + return false; + return this->emitGetPtrLocal(*LocalIndex, E); + } + + return true; + }; + + // The offset of the temporary, if we created one. + unsigned SubExprOffset = ~0u; + auto createTemp = [=, &SubExprOffset]() -> bool { + SubExprOffset = this->allocateLocalPrimitive(SubExpr, PT_Ptr, true, false); + if (!this->visit(SubExpr)) + return false; + return this->emitSetLocal(PT_Ptr, SubExprOffset, E); + }; + + const auto *VecT = SubExpr->getType()->getAs<VectorType>(); ---------------- tbaederr wrote:
The convention is that things ending in `T` are `PrimType`s. Call this `VT` or `VecTy`. https://github.com/llvm/llvm-project/pull/105996 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits