Skip to content

Commit

Permalink
[NFC][msan] Extract handleSelectLikeInst (llvm#94881)
Browse files Browse the repository at this point in the history
`blendv` instructions are very similar to `select`.
We will add support for them in followup patches.
  • Loading branch information
vitalybuka authored and Lukacma committed Jun 12, 2024
1 parent f83eec3 commit dc592b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4481,12 +4481,17 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
}

void visitSelectInst(SelectInst &I) {
IRBuilder<> IRB(&I);
// a = select b, c, d
Value *B = I.getCondition();
Value *C = I.getTrueValue();
Value *D = I.getFalseValue();

handleSelectLikeInst(I, B, C, D);
}

void handleSelectLikeInst(Instruction &I, Value *B, Value *C, Value *D) {
IRBuilder<> IRB(&I);

Value *Sb = getShadow(B);
Value *Sc = getShadow(C);
Value *Sd = getShadow(D);
Expand Down

0 comments on commit dc592b5

Please sign in to comment.