Skip to content

Commit 7fe951a

Browse files
authored
Revert "Reapply [hwasan] Update dbg.assign intrinsics in HWAsan pass … (#79186)
#78606" This reverts commit 13c6f1e because it causes an assertion in DebugInfoMetadata.cpp:1968 in Clang Linux builders for Fuchsia. https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8758111613576762817/+/u/clang/build/stdout
1 parent 32073b8 commit 7fe951a

File tree

7 files changed

+8
-214
lines changed

7 files changed

+8
-214
lines changed

llvm/lib/IR/DebugInfo.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,10 @@ bool AssignmentTrackingPass::runOnFunction(Function &F) {
22112211
if (F.hasFnAttribute(Attribute::OptimizeNone))
22122212
return /*Changed*/ false;
22132213

2214+
// FIXME: https://github.com/llvm/llvm-project/issues/76545
2215+
if (F.hasFnAttribute(Attribute::SanitizeHWAddress))
2216+
return /*Changed*/ false;
2217+
22142218
bool Changed = false;
22152219
auto *DL = &F.getParent()->getDataLayout();
22162220
// Collect a map of {backing storage : dbg.declares} (currently "backing

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,11 +1435,6 @@ bool HWAddressSanitizer::instrumentStack(memtag::StackInfo &SInfo,
14351435
if (DDI->getVariableLocationOp(LocNo) == AI)
14361436
DDI->setExpression(DIExpression::appendOpsToArg(DDI->getExpression(),
14371437
NewOps, LocNo));
1438-
if (auto *DAI = dyn_cast<DbgAssignIntrinsic>(DDI)) {
1439-
if (DAI->getAddress() == AI)
1440-
DAI->setAddressExpression(DIExpression::prependOpcodes(
1441-
DAI->getAddressExpression(), NewOps));
1442-
}
14431438
}
14441439

14451440
auto TagEnd = [&](Instruction *Node) {

llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,16 @@ void StackInfoBuilder::visit(Instruction &Inst) {
138138
return;
139139
}
140140
if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&Inst)) {
141-
auto AddIfInteresting = [&](Value *V) {
141+
for (Value *V : DVI->location_ops()) {
142142
if (auto *AI = dyn_cast_or_null<AllocaInst>(V)) {
143143
if (!isInterestingAlloca(*AI))
144-
return;
144+
continue;
145145
AllocaInfo &AInfo = Info.AllocasToInstrument[AI];
146146
auto &DVIVec = AInfo.DbgVariableIntrinsics;
147147
if (DVIVec.empty() || DVIVec.back() != DVI)
148148
DVIVec.push_back(DVI);
149149
}
150-
};
151-
for (Value *V : DVI->location_ops())
152-
AddIfInteresting(V);
153-
if (auto *DAI = dyn_cast<DbgAssignIntrinsic>(DVI))
154-
AddIfInteresting(DAI->getAddress());
150+
}
155151
}
156152
Instruction *ExitUntag = getUntagLocationIfFunctionExit(Inst);
157153
if (ExitUntag)

llvm/test/CodeGen/AArch64/dbg-assign-tag-offset-mix-loc.ll

Lines changed: 0 additions & 71 deletions
This file was deleted.

llvm/test/CodeGen/AArch64/dbg-assign-tag-offset.ll

Lines changed: 0 additions & 71 deletions
This file was deleted.

llvm/test/DebugInfo/Generic/assignment-tracking/declare-to-assign/hwasan.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt %s -S -passes=declare-to-assign -o - | FileCheck %s
22

3-
; CHECK: call void @llvm.dbg.assign
3+
; CHECK: call void @llvm.dbg.declare
44

55
define dso_local void @f() sanitize_hwaddress !dbg !9 {
66
entry:

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

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)