================ @@ -3356,6 +3356,37 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> { setOriginForNaryOp(I); } + Value *convertBlendvToSelectMask(IRBuilder<> &IRB, Value *C) { + C = CreateAppToShadowCast(IRB, C); + FixedVectorType *FVT = cast<FixedVectorType>(C->getType()); + unsigned ElSize = FVT->getElementType()->getPrimitiveSizeInBits(); + C = IRB.CreateAShr(C, ElSize - 1); + FVT = FixedVectorType::get(IRB.getInt1Ty(), FVT->getNumElements()); + return IRB.CreateTrunc(C, FVT); + } + + // `blendv(f, t, c)` is effectively `select(c[top_bit], t, f)`. + void handleBlendvIntrinsic(IntrinsicInst &I) { + Value *C = I.getOperand(2); + Value *T = I.getOperand(1); + Value *F = I.getOperand(0); + + Value *Sc = getShadow(&I, 2); + Value *Oc = MS.TrackOrigins ? getOrigin(C) : nullptr; + + { + IRBuilder<> IRB(&I); ---------------- fmayer wrote:
Why does it matter that this doesn't outlive `handleSelectLikeInst`? Because that also creates an IRBuilder? How does that work? That creates it from `&I` as well, which means these instructions get inserted before the ones here, right? https://github.com/llvm/llvm-project/pull/94882 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits