From 5e5aa9438d3b98465e804660308533dabc3dff65 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 13 Aug 2014 09:19:39 +0000 Subject: [PATCH] Revert r215415 which causse MSan to crash on a great deal of C++ code. I've followed up on the original commit as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215532 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/MemorySanitizer.cpp | 10 ---------- test/Instrumentation/MemorySanitizer/msan_basic.ll | 13 ------------- 2 files changed, 23 deletions(-) diff --git a/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 643faacc700..3df1d157412 100644 --- a/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2356,12 +2356,6 @@ struct MemorySanitizerVisitor : public InstVisitor { VAHelper->visitCallSite(CS, IRB); } - // If this is a musttail call site, we can't insert propagation code here. - // The return type of the caller must match the callee, so the shadow should - // already be set up for an immediate return. - if (CS.isMustTailCall()) - return; - // Now, get the shadow for the RetVal. if (!I.getType()->isSized()) return; IRBuilder<> IRBBefore(&I); @@ -2395,10 +2389,6 @@ struct MemorySanitizerVisitor : public InstVisitor { } void visitReturnInst(ReturnInst &I) { - // Don't propagate shadow between musttail calls and the return. - if (I.getParent()->getTerminatingMustTailCall()) - return; - IRBuilder<> IRB(&I); Value *RetVal = I.getReturnValue(); if (!RetVal) return; diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll index 27c23145e61..0faf45d70c5 100644 --- a/test/Instrumentation/MemorySanitizer/msan_basic.ll +++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll @@ -878,16 +878,3 @@ define void @MismatchedReturnTypeTailCall(i32 %a) sanitize_memory { ; CHECK-LABEL: define void @MismatchedReturnTypeTailCall ; CHECK: tail call i32 @InnerTailCall ; CHECK: ret void - -declare i32 @InnerMustTailCall(i32 %a) - -define i32 @MustTailCall(i32 %a) { - %b = musttail call i32 @InnerMustTailCall(i32 %a) - ret i32 %b -} - -; Test that 'musttail' is preserved. The ABI should make this work. - -; CHECK-LABEL: define i32 @MustTailCall -; CHECK: musttail call i32 @InnerMustTailCall -; CHECK-NEXT: ret i32