@@ -1460,8 +1460,6 @@ bool HWAddressSanitizer::instrumentStack(memtag::StackInfo &SInfo,
14601460 size_t Size = memtag::getAllocaSizeInBytes (*AI);
14611461 size_t AlignedSize = alignTo (Size, Mapping.getObjectAlignment ());
14621462
1463- Value *AICast = IRB.CreatePointerCast (AI, PtrTy);
1464-
14651463 auto HandleLifetime = [&](IntrinsicInst *II) {
14661464 // Set the lifetime intrinsic to cover the whole alloca. This reduces the
14671465 // set of assumptions we need to make about the lifetime. Without this we
@@ -1474,14 +1472,13 @@ bool HWAddressSanitizer::instrumentStack(memtag::StackInfo &SInfo,
14741472 // one set of start / end in any execution (i.e. the ends are not
14751473 // reachable from each other), so this will not cause any problems.
14761474 II->setArgOperand (0 , ConstantInt::get (Int64Ty, AlignedSize));
1477- II->setArgOperand (1 , AICast);
14781475 };
14791476 llvm::for_each (Info.LifetimeStart , HandleLifetime);
14801477 llvm::for_each (Info.LifetimeEnd , HandleLifetime);
14811478
1482- AI->replaceUsesWithIf (Replacement, [AICast, AILong](const Use &U) {
1479+ AI->replaceUsesWithIf (Replacement, [AILong](const Use &U) {
14831480 auto *User = U.getUser ();
1484- return User != AILong && User != AICast && !isa<LifetimeIntrinsic>(User);
1481+ return User != AILong && !isa<LifetimeIntrinsic>(User);
14851482 });
14861483
14871484 memtag::annotateDebugRecords (Info, retagMask (N));
0 commit comments