[clang] [llvm] Remove -bounds-checking-unique-traps (replace with -fno-sanitize-merge=local-bounds) (PR #120682)

2024-12-19 Thread Vitaly Buka via cfe-commits
@@ -1281,31 +1281,43 @@ parseRegAllocFastPassOptions(PassBuilder &PB, StringRef Params) { return Opts; } -Expected +Expected parseBoundsCheckingOptions(StringRef Params) { - BoundsCheckingPass::ReportingMode Mode = - BoundsCheckingPass::ReportingMode::Trap; + Bounds

[clang] [llvm] Remove -bounds-checking-unique-traps (replace with -fno-sanitize-merge=local-bounds) (PR #120682)

2024-12-19 Thread Vitaly Buka via cfe-commits
@@ -299,7 +303,7 @@ void BoundsCheckingPass::printPipeline( raw_ostream &OS, function_ref MapClassName2PassName) { static_cast *>(this)->printPipeline( OS, MapClassName2PassName); - switch (Mode) { + switch (Options.Mode) { vitalybuka wrote: you

[clang] [llvm] Remove -bounds-checking-unique-traps (replace with -fno-sanitize-merge=local-bounds) (PR #120682)

2024-12-19 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/120682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][ubsan] Pre-commit test with missed optimization (PR #119012)

2024-12-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/119012 None >From 6eeac907ceebf425417204a4892d86b26ef6c1b7 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 6 Dec 2024 11:18:07 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?

[clang] [NFC][Driver] Simplify linking of ubsan_standalone_cxx (PR #120938)

2024-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/120938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Simplify linking of ubsan_standalone_cxx (PR #120938)

2024-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/120938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Driver] Simplify linking of ubsan_standalone_cxx (PR #120938)

2024-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/120938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Simplify linking of ubsan_standalone_cxx (PR #120938)

2024-12-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/120938 None >From 1b260afe040e879e2202004ff8e33634666f586f Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sun, 22 Dec 2024 23:48:48 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia

[clang] [compiler-rt] [Clang] Adjust pointer-overflow sanitizer for N3322 (PR #120719)

2025-01-08 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/120719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [Clang] Adjust pointer-overflow sanitizer for N3322 (PR #120719)

2025-01-08 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > @vitalybuka Should I also be dropping checks like > > https://github.com/llvm/llvm-project/blob/5f0db7c11264fa235d73730b2b93a31407dfbef3/compiler-rt/lib/ubsan/ubsan_handlers.cpp#L817-L818 > > from the ubsan runtime? (Not sure whether the runtime is supposed to also be > com

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-08 Thread Vitaly Buka via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-08 Thread Vitaly Buka via cfe-commits
@@ -3430,13 +3430,25 @@ void FunctionStackPoisoner::processStaticAllocas() { SmallVector SVD; SVD.reserve(AllocaVec.size()); for (AllocaInst *AI : AllocaVec) { -ASanStackVariableDescription D = {AI->getName().data(), - ASan.getAllo

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-08 Thread Vitaly Buka via cfe-commits
@@ -2649,6 +2649,14 @@ def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-unde HelpText<"Strip (or keep only, if negative) a given number of path components " "when emitting check metadata.">, MarshallingInfoInt, "0", "int">; +def fno_

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-08 Thread Vitaly Buka via cfe-commits
@@ -44,6 +92,19 @@ void clang::serializeSanitizerSet(SanitizerSet Set, #include "clang/Basic/Sanitizers.def" } +void clang::serializeSanitizerMaskCutoffs( +const SanitizerMaskCutoffs &Cutoffs, SmallVectorImpl &Values) { +#define SANITIZER(NAME, ID)

[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

2025-01-08 Thread Vitaly Buka via cfe-commits
@@ -1154,3 +1154,56 @@ // RUN: not %clang --target=x86_64-linux-gnu -fsanitize=realtime,undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-REALTIME-UBSAN // CHECK-REALTIME-UBSAN: error: invalid argument '-fsanitize=realtime' not allowed with '-fsanitize=undefined' +

[clang] [nfc][ubsan] Use O1 in test to remove more unrelated stuff (PR #122408)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/122408 >From 5da780d61aaa329ec66c5a874caeb1de50969342 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 18:16:37 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/122415 >From 0021fbc549fcc8c27b184af163ba963c31acc0c1 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 20:26:03 -0800 Subject: [PATCH 1/3] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/122415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFCI][BoundsChecking] Apply nosanitize on local-bounds instrumentation (PR #122416)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/122416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-10 Thread Vitaly Buka via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-10 Thread Vitaly Buka via cfe-commits
@@ -3391,6 +3391,29 @@ static void findStoresToUninstrumentedArgAllocas( } } +StringRef getAllocaName(AllocaInst *AI) { + StringRef Name = AI->getName(); + + // Alloca could have been renamed for uniqueness. Its true name will have been + // recorded as an annotation. +

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: > Would it be useful to keep -fsanitize=...null and add local-bounds instead of > replacing null with local-bounds? It would make the test more rigorous and > also make the diff smaller. > > **edit:** or is it not possible to make a test case that is local-bounds > sanitized

[clang] [NFCI][BoundsChecking] Apply nosanitize on local-bounds instrumentation (PR #122416)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/122416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/122415 >From 0021fbc549fcc8c27b184af163ba963c31acc0c1 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 20:26:03 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20ch?= =?U

[clang] [compiler-rt] [llvm] [ASan] Add metadata to renamed instructions so ASan doesn't use the i… (PR #119387)

2025-01-10 Thread Vitaly Buka via cfe-commits
@@ -137,6 +137,10 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty, Alloca = new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(), ArraySize, Name, AllocaInsertPt->getIterator()); + if (Alloca->getName

[clang] -ftime-report: reorganize timers (PR #122225)

2025-01-09 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Probably from the prev patch I have: ``` /usr/local/google/home/vitalybuka/src/llvm.git/llvm-project/clang/test/Frontend/ftime-report-template-decl.cpp:155:15: error: CHECK-DAG: expected string not found in input // CHECK-DAG: Code Generation Time ^ :75:32: note:

[clang] a4394d9 - [NFC][ubsan] Rename prefixes in test

2025-01-09 Thread Vitaly Buka via cfe-commits
Author: Vitaly Buka Date: 2025-01-09T21:12:36-08:00 New Revision: a4394d9d42fb6e60e3702588fb56bec243038c49 URL: https://github.com/llvm/llvm-project/commit/a4394d9d42fb6e60e3702588fb56bec243038c49 DIFF: https://github.com/llvm/llvm-project/commit/a4394d9d42fb6e60e3702588fb56bec243038c49.diff L

[clang] [ubsan] Assert that each check only has one SanitizerKind (PR #122392)

2025-01-09 Thread Vitaly Buka via cfe-commits
@@ -3603,6 +3603,8 @@ void CodeGenFunction::EmitCheck( llvm::Value *TrapCond = nullptr; bool NoMerge = false; for (int i = 0, n = Checked.size(); i < n; ++i) { vitalybuka wrote: Maybe instead switch SanitizerMask -> SanitizerOrdinal? https://github.com/

[clang] [llvm] [nfc][BoundsChecking] Rename BoundsCheckingOptions into Options (PR #122359)

2025-01-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/122359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [nfc][BoundsChecking] Refactor BoundsCheckingOptions (PR #122346)

2025-01-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/122346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [sanitizer] Parse weighted sanitizer args and -fsanitize-skip-hot-cutoff (PR #121619)

2025-01-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/121619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][ubsan] Use O3 in test to remove more unrelated stuff (PR #122408)

2025-01-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/122408 None >From 5da780d61aaa329ec66c5a874caeb1de50969342 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 18:16:37 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?

[clang] [nfc][ubsan] Use O3 in test to remove more unrelated stuff (PR #122408)

2025-01-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/122408 >From 5da780d61aaa329ec66c5a874caeb1de50969342 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 18:16:37 -0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =?U

[clang] [nfc][ubsan] Use O1 in test to remove more unrelated stuff (PR #122408)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/122408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/122415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][ubsan] Add local-bounds test (PR #122415)

2025-01-10 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/122415 >From 0021fbc549fcc8c27b184af163ba963c31acc0c1 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 9 Jan 2025 20:26:03 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?= =?U

[clang] [NFC][Index] Disable LSAN on crash recovery tests (PR #124035)

2025-01-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/124035 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [NFC][modules] Create objects on the stack (PR #124034)

2025-01-22 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124034 >From cd4ff6baa7b70fa32483bb31253b312a983c468e Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 22 Jan 2025 16:16:59 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?

[clang-tools-extra] [NFC][modules] Create objects on the stack (PR #124034)

2025-01-23 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/124034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TySan] Add initial documentation for Type Sanitizer (PR #123595)

2025-01-24 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: Maybe paragraph or link to a doc about how it works can be useful? Basic understanding of algorithm may help users to avoid false expectations. https://github.com/llvm/llvm-project/pull/123595 ___ cfe-commits mailing list cfe-commits

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -828,11 +828,34 @@ parseLowerAllowCheckPassOptions(StringRef Params) { StringRef ParamName; std::tie(ParamName, Params) = Params.split(';'); -return make_error( -formatv("invalid LowerAllowCheck pass parameter '{0}' ", ParamName) -.str(), -

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -71,7 +72,8 @@ static void emitRemark(IntrinsicInst *II, OptimizationRemarkEmitter &ORE, static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, const ProfileSummaryInfo *PSI, - OptimizationRemarkEmi

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -108,14 +108,17 @@ static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal, return Or; } -static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB) { +static CallInst *InsertTrap(BuilderTy &IRB, bool DebugTrapBB, vitalybuka wrote: Changes in thi

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -81,21 +83,20 @@ static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, return *Rng; }; - auto ShouldRemoveHot = [&](const BasicBlock &BB) { -return HotPercentileCutoff.getNumOccurrences() && PSI && - PSI->isHotCountNthPercentile( -

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -81,21 +83,20 @@ static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, return *Rng; }; - auto ShouldRemoveHot = [&](const BasicBlock &BB) { -return HotPercentileCutoff.getNumOccurrences() && PSI && - PSI->isHotCountNthPercentile( -

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -107,7 +108,18 @@ static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, case Intrinsic::allow_runtime_check: { ++NumChecksTotal; -bool ToRemove = ShouldRemove(BB); +bool ToRemove = ShouldRemoveRandom(); + +unsigned i

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -107,7 +108,18 @@ static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, case Intrinsic::allow_runtime_check: { ++NumChecksTotal; -bool ToRemove = ShouldRemove(BB); +bool ToRemove = ShouldRemoveRandom(); + +unsigned i

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
@@ -2,6 +2,14 @@ ; RUN: opt < %s -passes='function(lower-allow-check)' -S | FileCheck %s --check-prefixes=NOPROFILE ; RUN: opt < %s -passes='function(lower-allow-check)' -lower-allow-check-random-rate=0 -S | FileCheck %s --check-prefixes=NONE ; RUN: opt < %s -passes='function

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka requested changes to this pull request. Lets move clang part into a new PR? https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ubsan] Plumb through -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124211)

2025-01-26 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/123470 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_hwasan %s -o %t && %env_hwasan_opts=random_tags=1 %run %t +// RUN: %clang_hwasan -Wno-error=return-type %s -o %t && %env_hwasan_opts=random_tags=1 %run %t vitalybuka wrote: why not just to return nullptr? https://github.com/llvm/

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -2,10 +2,10 @@ // UNSUPPORTED: target=thumb{{.*}} // UNSUPPORTED: android -// RUN: %clangxx -fsanitize=return %gmlt -O2 -fno-omit-frame-pointer -fasynchronous-unwind-tables %s -o %t +// RUN: %clangxx -Wno-error=return-type -fsanitize=return %gmlt -O2 -fno-omit-frame-point

[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_hwasan %s -o %t && %env_hwasan_opts=random_tags=1 %run %t +// RUN: %clang_hwasan -Wno-error=return-type %s -o %t && %env_hwasan_opts=random_tags=1 %run %t vitalybuka wrote: It should be fine to change HWASAN tests, it does nothing

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -2,6 +2,14 @@ ; RUN: opt < %s -passes='function(lower-allow-check)' -S | FileCheck %s --check-prefixes=NOPROFILE ; RUN: opt < %s -passes='function(lower-allow-check)' -lower-allow-check-random-rate=0 -S | FileCheck %s --check-prefixes=NONE ; RUN: opt < %s -passes='function

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -828,11 +828,66 @@ parseLowerAllowCheckPassOptions(StringRef Params) { StringRef ParamName; std::tie(ParamName, Params) = Params.split(';'); -return make_error( -formatv("invalid LowerAllowCheck pass parameter '{0}' ", ParamName) -.str(), -

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/124211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -71,7 +72,8 @@ static void emitRemark(IntrinsicInst *II, OptimizationRemarkEmitter &ORE, static bool removeUbsanTraps(Function &F, const BlockFrequencyInfo &BFI, const ProfileSummaryInfo *PSI, - OptimizationRemarkEmi

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -828,11 +828,66 @@ parseLowerAllowCheckPassOptions(StringRef Params) { StringRef ParamName; std::tie(ParamName, Params) = Params.split(';'); -return make_error( -formatv("invalid LowerAllowCheck pass parameter '{0}' ", ParamName) -.str(), -

[clang] [llvm] [ubsan] Parse and use in LowerAllowCheckPass (PR #124211)

2025-01-27 Thread Vitaly Buka via cfe-commits
@@ -2314,7 +2314,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.SanitizeSkipHotCutoffs = parseSanitizerWeightedKinds( "-fsanitize-skip-hot-cutoff=", Args.getAllArgValues(OPT_fsanitize_skip_hot_cutoff_EQ), Diags); - --

[clang] [llvm] [BoundsChecking] Update ubsantrap to use GuardKind (PR #124613)

2025-01-28 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/124613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,29 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + bool lowerAllowCheck = LowerAllowCheckPass::IsRequested(); + // Is there a non-zero cuto

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,29 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + bool lowerAllowCheck = LowerAllowCheckPass::IsRequested(); + // Is there a non-zero cuto

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -3614,29 +3614,35 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; + // Expand checks into: + // (Check1 || !allow_ubsan_check) && (Check2 || !allow_ubsan_check) ... + // We need sep

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -3614,29 +3614,35 @@ void CodeGenFunction::EmitCheck( llvm::Value *RecoverableCond = nullptr; llvm::Value *TrapCond = nullptr; bool NoMerge = false; + // Expand checks into: + // (Check1 || !allow_ubsan_check) && (Check2 || !allow_ubsan_check) ... + // We need sep

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,29 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + bool lowerAllowCheck = LowerAllowCheckPass::IsRequested(); vitalybuka wr

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -7,18 +10,26 @@ // CHECK-LABEL: define dso_local noundef i32 @div( // CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { // CHECK-NEXT: [[ENTRY:.*:]] -// CHECK-NEXT:[[TMP0:%.*]] = icmp eq i32 [[Y]], 0, !nosanitize [[META2:

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-28 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,29 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + bool lowerAllowCheck = LowerAllowCheckPass::IsRequested(); + // Is there a non-zero cuto

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -43,6 +44,23 @@ std::optional SanitizerMaskCutoffs::operator[](unsigned Kind) const { void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); } +std::optional> +SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { + std::vector scaledCutoffs; + + bool an

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/10] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/11] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/12] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/13] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/14] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/124857 >From 68246540d28c765af1fe4d61244e35cc8ff723cc Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 22 Jan 2025 18:59:07 + Subject: [PATCH 01/15] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAll

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/124857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Always Dup in createRef (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/125020 We can't guaranty that underlying string is 0-terminated and [String.size()] is even in the same allocation. >From 10af91096eda7eb2b7f07cf239f53ac3af456566 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: W

[clang] [libclang] Always Dup in createRef (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Always Dup in createRef (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Always Dup in createRef (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: It does not look nice for memory usage, but I don't know how critical it's here. It's it's unacceptable, then `__attribute__((no_sanitize("memory")))` is an option. https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mai

[clang] [libclang] Always Dup in createRef(StringRef) (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass" (#125032) (PR #125037)

2025-01-30 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/125037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -43,6 +44,23 @@ std::optional SanitizerMaskCutoffs::operator[](unsigned Kind) const { void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); } +std::optional> +SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { + std::vector scaledCutoffs; + + bool an

[clang] [libclang] Always Dup in createRef(StringRef) (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang] Always Dup in createRef(StringRef) (PR #125020)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/125020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -43,6 +44,23 @@ std::optional SanitizerMaskCutoffs::operator[](unsigned Kind) const { void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); } +std::optional> +SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { + std::vector scaledCutoffs; + + bool an

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -43,6 +44,23 @@ std::optional SanitizerMaskCutoffs::operator[](unsigned Kind) const { void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); } +std::optional> +SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { + std::vector scaledCutoffs;

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. With nits https://github.com/llvm/llvm-project/pull/124857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass (PR #124857)

2025-01-29 Thread Vitaly Buka via cfe-commits
@@ -795,12 +795,30 @@ static void addSanitizers(const Triple &TargetTriple, PB.registerOptimizerLastEPCallback(SanitizersCallback); } - if (LowerAllowCheckPass::IsRequested()) { + // SanitizeSkipHotCutoffs: doubles with range [0, 1] + // Opts.cutoffs: ints with range

[clang] [llvm] [NFC][BoundsChecking] Address #122576 review comments (PR #122773)

2025-01-13 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/122773 None >From b6abdc748225c29544d3c82bfafb5fac3dfd67a7 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 13 Jan 2025 11:30:49 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia

[clang] [NFC][Driver] Use global --implicit-check-not=libclang_rt (PR #121081)

2024-12-24 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/121081 Simplifies and improve precision of the test. >From 75aa55a129dd1311a889a9bb4b0f4ee04206d157 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 24 Dec 2024 19:38:02 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=

[clang] [compiler-rt] [Ubsan][Driver] Remove UBSAN C++ runtime from other sanitizers (PR #121006)

2024-12-24 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka closed https://github.com/llvm/llvm-project/pull/121006 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    7   8   9   10   11   12   13   14   15   >