forked from OSchip/llvm-project
[msan] Handle vector manipulation instructions.
Handle insertelement, extractelement, shufflevector. llvm-svn: 168889
This commit is contained in:
parent
f433cecf96
commit
30484fc704
|
@ -743,6 +743,31 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
|||
IRB.CreateAlignedStore(getOrigin(Val), getOriginPtr(Addr, IRB), I.getAlignment());
|
||||
}
|
||||
|
||||
// Vector manipulation.
|
||||
void visitExtractElementInst(ExtractElementInst &I) {
|
||||
insertCheck(I.getOperand(1), &I);
|
||||
IRBuilder<> IRB(&I);
|
||||
setShadow(&I, IRB.CreateExtractElement(getShadow(&I, 0), I.getOperand(1),
|
||||
"_msprop"));
|
||||
setOrigin(&I, getOrigin(&I, 0));
|
||||
}
|
||||
|
||||
void visitInsertElementInst(InsertElementInst &I) {
|
||||
insertCheck(I.getOperand(2), &I);
|
||||
IRBuilder<> IRB(&I);
|
||||
setShadow(&I, IRB.CreateInsertElement(getShadow(&I, 0), getShadow(&I, 1),
|
||||
I.getOperand(2), "_msprop"));
|
||||
setOriginForNaryOp(I);
|
||||
}
|
||||
|
||||
void visitShuffleVectorInst(ShuffleVectorInst &I) {
|
||||
insertCheck(I.getOperand(2), &I);
|
||||
IRBuilder<> IRB(&I);
|
||||
setShadow(&I, IRB.CreateShuffleVector(getShadow(&I, 0), getShadow(&I, 1),
|
||||
I.getOperand(2), "_msprop"));
|
||||
setOriginForNaryOp(I);
|
||||
}
|
||||
|
||||
// Casts.
|
||||
void visitSExtInst(SExtInst &I) {
|
||||
IRBuilder<> IRB(&I);
|
||||
|
|
Loading…
Reference in New Issue