[HWASan] remove replacement of DbgVariableIntrinsics.
authorFlorian Mayer <fmayer@google.com>
Tue, 15 Feb 2022 02:25:45 +0000 (18:25 -0800)
committerFlorian Mayer <fmayer@google.com>
Tue, 15 Feb 2022 19:40:58 +0000 (11:40 -0800)
This code was dead because we AI->replaceUsesWithIf above. I verified
this doesn't actually get run by applying
https://gist.github.com/fmayer/aea7cbb4700cfe2c9d932591ae1073c3 to the
Android toolchain and building AOSP, without any crash.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119802

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

index 1c54955..0d59973 100644 (file)
@@ -1378,19 +1378,8 @@ bool HWAddressSanitizer::instrumentStack(
           II->eraseFromParent();
       }
     }
-    if (memtag::alignAndPadAlloca(Info, Align(Mapping.getObjectAlignment()))) {
-      for (auto DVI : Info.DbgVariableIntrinsics) {
-        SmallDenseSet<Value *> LocationOps(DVI->location_ops().begin(),
-                                           DVI->location_ops().end());
-        for (Value *V : LocationOps) {
-          if (auto *AI = dyn_cast_or_null<AllocaInst>(V)) {
-            if (V == AI)
-              DVI->replaceVariableLocationOp(V, Info.AI);
-          }
-        }
-      }
+    if (memtag::alignAndPadAlloca(Info, Align(Mapping.getObjectAlignment())))
       AI->eraseFromParent();
-    }
   }
   for (auto &I : SInfo.UnrecognizedLifetimes)
     I->eraseFromParent();