[all-commits] [llvm/llvm-project] 0d15d4: [ubsan] Change ubsan-unique-traps to use nomerge i...
Thurston Dang via All-commits
all-commits at lists.llvm.org
Tue Nov 26 21:13:21 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0d15d46362bd6ab5a9a2165805adaab13a7689f4
https://github.com/llvm/llvm-project/commit/0d15d46362bd6ab5a9a2165805adaab13a7689f4
Author: Thurston Dang <thurston at google.com>
Date: 2024-11-26 (Tue, 26 Nov 2024)
Changed paths:
M clang/lib/CodeGen/CGExpr.cpp
M clang/test/CodeGen/bounds-checking.c
M clang/test/CodeGen/catch-undef-behavior.c
M clang/test/CodeGen/ubsan-trap-merge.c
M llvm/test/CodeGen/X86/ubsan-trap-merge.ll
M llvm/test/CodeGen/X86/ubsan-trap-nomerge.ll
Log Message:
-----------
[ubsan] Change ubsan-unique-traps to use nomerge instead of counter (#117651)
https://github.com/llvm/llvm-project/pull/65972 (continuation of
https://reviews.llvm.org/D148654) had considered adding nomerge to
ubsantrap, but did not proceed with that because of
https://github.com/llvm/llvm-project/issues/53011. Instead, it added a
counter (based on TrapBB->getParent()->size()) to each ubsantrap call.
However, this counter is not guaranteed to be unique after inlining, as
shown by https://github.com/llvm/llvm-project/pull/83470, which can
result in ubsantraps being merged by the backend.
https://github.com/llvm/llvm-project/pull/101549 has since fixed the
nomerge limitation ("It sets nomerge flag for the node if the
instruction has nomerge arrtibute."). This patch therefore takes
advantage of nomerge instead of using the counter, guaranteeing that the
ubsantraps are not merged.
This patch is equivalent to
https://github.com/llvm/llvm-project/pull/83470 but also adds nomerge
and updates tests (https://github.com/llvm/llvm-project/pull/117649:
ubsan-trap-merge.c; https://github.com/llvm/llvm-project/pull/117657:
ubsan-trap-merge.ll, ubsan-trap-nomerge.ll; catch-undef-behavior.c).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list