diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp index 41ad2ddac30d..6adf99531e30 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGExprScalar.cpp @@ -1894,8 +1894,8 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { // initializer, since LLVM optimizers generally do not want to touch // shuffles. unsigned CurIdx = 0; - bool VIsUndefShuffle = false; - llvm::Value *V = llvm::UndefValue::get(VType); + bool VIsPoisonShuffle = false; + llvm::Value *V = llvm::PoisonValue::get(VType); for (unsigned i = 0; i != NumInitElements; ++i) { Expr *IE = E->getInit(i); Value *Init = Visit(IE); @@ -1915,16 +1915,16 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { llvm::ConstantInt *C = cast<llvm::ConstantInt>(EI->getIndexOperand()); Value *LHS = nullptr, *RHS = nullptr; if (CurIdx == 0) { - // insert into undef -> shuffle (src, undef) + // insert into poison -> shuffle (src, poison) // shufflemask must use an i32 Args.push_back(getAsInt32(C, CGF.Int32Ty)); Args.resize(ResElts, -1); LHS = EI->getVectorOperand(); RHS = V; - VIsUndefShuffle = true; - } else if (VIsUndefShuffle) { - // insert into undefshuffle && size match -> shuffle (v, src) + VIsPoisonShuffle = true; + } else if (VIsPoisonShuffle) { + // insert into poison shuffle && size match -> shuffle (v, src) llvm::ShuffleVectorInst *SVV = cast<llvm::ShuffleVectorInst>(V); for (unsigned j = 0; j != CurIdx; ++j) Args.push_back(getMaskElt(SVV, j, 0)); @@ -1933,7 +1933,7 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { LHS = cast<llvm::ShuffleVectorInst>(V)->getOperand(0); RHS = EI->getVectorOperand(); - VIsUndefShuffle = false; + VIsPoisonShuffle = false; } if (!Args.empty()) { V = Builder.CreateShuffleVector(LHS, RHS, Args); @@ -1944,7 +1944,7 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { } V = Builder.CreateInsertElement(V, Init, Builder.getInt32(CurIdx), "vecinit"); - VIsUndefShuffle = false; + VIsPoisonShuffle = false; ++CurIdx; continue; } @@ -1962,9 +1962,9 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { if (OpTy->getNumElements() == ResElts) { for (unsigned j = 0; j != CurIdx; ++j) { - // If the current vector initializer is a shuffle with undef, merge + // If the current vector initializer is a shuffle with poison, merge // this shuffle directly into it. - if (VIsUndefShuffle) { + if (VIsPoisonShuffle) { Args.push_back(getMaskElt(cast<llvm::ShuffleVectorInst>(V), j, 0)); } else { Args.push_back(j); @@ -1974,7 +1974,7 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { Args.push_back(getMaskElt(SVI, j, Offset)); Args.resize(ResElts, -1); - if (VIsUndefShuffle) + if (VIsPoisonShuffle) V = cast<llvm::ShuffleVectorInst>(V)->getOperand(0); Init = SVOp; @@ -1997,12 +1997,12 @@ Value *ScalarExprEmitter::VisitInitListExpr(InitListExpr *E) { Args.resize(ResElts, -1); } - // If V is undef, make sure it ends up on the RHS of the shuffle to aid + // If V is poison, make sure it ends up on the RHS of the shuffle to aid // merging subsequent shuffles into this one. if (CurIdx == 0) std::swap(V, Init); V = Builder.CreateShuffleVector(V, Init, Args, "vecinit"); - VIsUndefShuffle = isa<llvm::UndefValue>(Init); + VIsPoisonShuffle = isa<llvm::PoisonValue>(Init); CurIdx += InitElts; } |