[PATCH] D135639: [MC] Consider IsMTETaggedFrame in CIEKey
Florian Mayer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 12:44:29 PDT 2022
fmayer created this revision.
Herald added subscribers: mikhail.ramalho, hiraditya.
Herald added a project: All.
fmayer updated this revision to Diff 466896.
fmayer added a comment.
Herald added a subscriber: emaste.
fmayer added a reviewer: pcc.
fmayer edited reviewers, added: eugenis; removed: pcc.
fmayer published this revision for review.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
test
Before this, we would incorrectly coalesce CIE for frames with and
without stack MTE.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135639
Files:
llvm/lib/MC/MCDwarf.cpp
llvm/test/MC/ELF/AArch64/cfi.s
Index: llvm/test/MC/ELF/AArch64/cfi.s
===================================================================
--- llvm/test/MC/ELF/AArch64/cfi.s
+++ llvm/test/MC/ELF/AArch64/cfi.s
@@ -24,6 +24,7 @@
f3:
.cfi_startproc
.cfi_lsda 0x3, bar
+ .cfi_mte_tagged_frame
nop
.cfi_endproc
@@ -244,7 +245,7 @@
// CHECK-NEXT: 0000: 10000000 00000000 017A5200 017C1E01 |.........zR..|..|
// CHECK-NEXT: 0010: 1B000000 10000000 18000000 00000000 |................|
// CHECK-NEXT: 0020: 04000000 00000000 14000000 00000000 |................|
-// CHECK-NEXT: 0030: 017A4C52 00017C1E 02031B0C 1F000000 |.zLR..|.........|
+// CHECK-NEXT: 0030: 017A4C52 4700017C 1E02031B 0C1F0000 |.zLRG..|........|
// CHECK-NEXT: 0040: 14000000 1C000000 00000000 04000000 |................|
// CHECK-NEXT: 0050: 04000000 00000000 14000000 00000000 |................|
// CHECK-NEXT: 0060: 017A4C52 4200017C 1E02031B 0C1F0000 |.zLRB..|........|
Index: llvm/lib/MC/MCDwarf.cpp
===================================================================
--- llvm/lib/MC/MCDwarf.cpp
+++ llvm/lib/MC/MCDwarf.cpp
@@ -1774,27 +1774,29 @@
struct CIEKey {
static const CIEKey getEmptyKey() {
return CIEKey(nullptr, 0, -1, false, false, static_cast<unsigned>(INT_MAX),
- false);
+ false, false);
}
static const CIEKey getTombstoneKey() {
return CIEKey(nullptr, -1, 0, false, false, static_cast<unsigned>(INT_MAX),
- false);
+ false, false);
}
CIEKey(const MCSymbol *Personality, unsigned PersonalityEncoding,
unsigned LSDAEncoding, bool IsSignalFrame, bool IsSimple,
- unsigned RAReg, bool IsBKeyFrame)
+ unsigned RAReg, bool IsBKeyFrame, bool IsMTETaggedFrame)
: Personality(Personality), PersonalityEncoding(PersonalityEncoding),
LsdaEncoding(LSDAEncoding), IsSignalFrame(IsSignalFrame),
- IsSimple(IsSimple), RAReg(RAReg), IsBKeyFrame(IsBKeyFrame) {}
+ IsSimple(IsSimple), RAReg(RAReg), IsBKeyFrame(IsBKeyFrame),
+ IsMTETaggedFrame(IsMTETaggedFrame) {}
explicit CIEKey(const MCDwarfFrameInfo &Frame)
: Personality(Frame.Personality),
PersonalityEncoding(Frame.PersonalityEncoding),
LsdaEncoding(Frame.LsdaEncoding), IsSignalFrame(Frame.IsSignalFrame),
IsSimple(Frame.IsSimple), RAReg(Frame.RAReg),
- IsBKeyFrame(Frame.IsBKeyFrame) {}
+ IsBKeyFrame(Frame.IsBKeyFrame),
+ IsMTETaggedFrame(Frame.IsMTETaggedFrame) {}
StringRef PersonalityName() const {
if (!Personality)
@@ -1817,6 +1819,7 @@
bool IsSimple;
unsigned RAReg;
bool IsBKeyFrame;
+ bool IsMTETaggedFrame;
};
} // end anonymous namespace
@@ -1828,9 +1831,10 @@
static CIEKey getTombstoneKey() { return CIEKey::getTombstoneKey(); }
static unsigned getHashValue(const CIEKey &Key) {
- return static_cast<unsigned>(hash_combine(
- Key.Personality, Key.PersonalityEncoding, Key.LsdaEncoding,
- Key.IsSignalFrame, Key.IsSimple, Key.RAReg, Key.IsBKeyFrame));
+ return static_cast<unsigned>(
+ hash_combine(Key.Personality, Key.PersonalityEncoding, Key.LsdaEncoding,
+ Key.IsSignalFrame, Key.IsSimple, Key.RAReg,
+ Key.IsBKeyFrame, Key.IsMTETaggedFrame));
}
static bool isEqual(const CIEKey &LHS, const CIEKey &RHS) {
@@ -1839,7 +1843,8 @@
LHS.LsdaEncoding == RHS.LsdaEncoding &&
LHS.IsSignalFrame == RHS.IsSignalFrame &&
LHS.IsSimple == RHS.IsSimple && LHS.RAReg == RHS.RAReg &&
- LHS.IsBKeyFrame == RHS.IsBKeyFrame;
+ LHS.IsBKeyFrame == RHS.IsBKeyFrame &&
+ LHS.IsMTETaggedFrame == RHS.IsMTETaggedFrame;
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135639.466896.patch
Type: text/x-patch
Size: 3806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221012/e78ddba6/attachment.bin>
More information about the llvm-commits
mailing list