This is an archive of the discontinued LLVM Phabricator instance.

[HWASan] remove replacement of DbgVariableIntrinsics.
ClosedPublic

Authored by fmayer on Feb 14 2022, 6:26 PM.

Details

Summary

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.

Diff Detail

Event Timeline

fmayer created this revision.Feb 14 2022, 6:26 PM
fmayer requested review of this revision.Feb 14 2022, 6:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 6:26 PM
fmayer added a reviewer: pcc.Feb 14 2022, 6:27 PM
fmayer added a subscriber: eugenis.
fmayer planned changes to this revision.EditedFeb 14 2022, 6:41 PM

Oh hold on, maybe what we actually want (to fix this) is to replace NewPtr (the BitCast from alignAndPadAlloca) with Info.AI. Sorry for jumping the gun here, the change as is is correct in that it keeps current behaviour, but that is possibly not what we want.

fmayer requested review of this revision.EditedFeb 14 2022, 6:46 PM

Oh hold on, maybe what we actually want (to fix this) is to replace NewPtr (the BitCast from alignAndPadAlloca) with Info.AI. Sorry for jumping the gun here, the change as is is correct in that it keeps current behaviour, but that is possibly not what we want.

Nevermind, no. We actually want the cast, because otherwise we cast to the (wrong) type of the padded alloca; or at least that's what the test in asserting. Correct me if that's wrong.

Oh hold on, maybe what we actually want (to fix this) is to replace NewPtr (the BitCast from alignAndPadAlloca) with Info.AI. Sorry for jumping the gun here, the change as is is correct in that it keeps current behaviour, but that is possibly not what we want.

Nevermind, no. We actually want the cast, because otherwise we cast to the (wrong) type of the padded alloca; or at least that's what the test in asserting. Correct me if that's wrong.

Which test?

Oh hold on, maybe what we actually want (to fix this) is to replace NewPtr (the BitCast from alignAndPadAlloca) with Info.AI. Sorry for jumping the gun here, the change as is is correct in that it keeps current behaviour, but that is possibly not what we want.

Nevermind, no. We actually want the cast, because otherwise we cast to the (wrong) type of the padded alloca; or at least that's what the test in asserting. Correct me if that's wrong.

Which test?

llvm/test/Instrumentation/HWAddressSanitizer/dbg-value-tag-offset.ll

This revision is now accepted and ready to land.Feb 15 2022, 11:36 AM
This revision was automatically updated to reflect the committed changes.

Correcting the commit message (sorry): This never got run, because in alignAndPadAlloca we call replaceAllUsesWith, which includes all metadata uses. This means we would never find a LocationOp with AI as value. This was also true before the refactoring to use a shared alignAndPadAlloca, because the loop only got run if !AllocaToPaddedAllocaMap.empty(), which only got populated in the padding code.