Skip to content

Commit

Permalink
Revert setOriginForNaryOp
Browse files Browse the repository at this point in the history
  • Loading branch information
thurstond committed Jul 17, 2024
1 parent f3aa040 commit 6d15040
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,21 +2484,13 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
using OriginCombiner = Combiner<false>;

/// Propagate origin for arbitrary operation.
///
/// Optionally skips n trailing operands.
void setOriginForNaryOp(Instruction &I, unsigned int skipLastOperands = 0) {
void setOriginForNaryOp(Instruction &I) {
if (!MS.TrackOrigins)
return;
IRBuilder<> IRB(&I);
OriginCombiner OC(this, IRB);

if (skipLastOperands > 0)
assert((I.getNumOperands() > skipLastOperands) &&
"Insufficient number of operands to skip!");

for (unsigned int i = 0; i < I.getNumOperands() - skipLastOperands; i++)
OC.Add(I.getOperand(i));

for (Use &Op : I.operands())
OC.Add(Op.get());
OC.Done(&I);
}

Expand Down Expand Up @@ -3860,12 +3852,10 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
IRB.CreateAlignedStore(interleavedShadow, ShadowPtr, Align(1));

if (MS.TrackOrigins) {
// We don't use the last two operands to compute the origin, because:
// - the last operand is the callee
// e.g., 'declare void @llvm.aarch64.neon.st2.v8i16.p0(...'
// - the second-last operand is the return value
// e.g., '%arraydecay74 = getelementptr inbounds ...'
setOriginForNaryOp(I, 2);
OriginCombiner OC(this, IRB);
for (int i = 0; i < numArgOperands - 1; i++)
OC.Add(I.getOperand(i));
OC.Done(&I);
}

if (ClCheckAccessAddress)
Expand Down

0 comments on commit 6d15040

Please sign in to comment.