Skip to content

Commit 2a4f1f4

Browse files
authored
Document FP relative offsets (#91031)
1 parent 1e36c96 commit 2a4f1f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,9 @@ Value *HWAddressSanitizer::getFrameRecordInfo(IRBuilder<> &IRB) {
12711271
// FP is 0xfffffffffffFFFF0 (4 lower bits are zero)
12721272
// We only really need ~20 lower non-zero bits (FFFF), so we mix like this:
12731273
// 0xFFFFPPPPPPPPPPPP
1274+
//
1275+
// FP works because in AArch64FrameLowering::getFrameIndexReference, we
1276+
// prefer FP-relative offsets for functions compiled with HWASan.
12741277
FP = IRB.CreateShl(FP, 44);
12751278
return IRB.CreateOr(PC, FP);
12761279
}

0 commit comments

Comments
 (0)