[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka planned changes to this revision. vitalybuka added a comment. I'll probably abandon this. I've converted the pass into pure analysis and I need to upstream that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80046/new/ https://reviews.l

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D80046#2042937 , @efriedma wrote: > Okay, I think we're mostly on the same page, then. Probably most important is Q no. 4. > I have a few issues here: > > 1. Whether the backend wants this information is really a per-func

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-18 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Okay, I think we're mostly on the same page, then. I have a few issues here: 1. Whether the backend wants this information is really a per-function decision, not a per-module decision; using module-level metadata is sort of weird. 2. Having weird rules like this makes

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D80046#2042874 , @vitalybuka wrote: > In D80046#2040309 , @efriedma wrote: > > > If I'm understanding this correctly, the stack-safe metadata on allocas is > > both produced and consu

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D80046#2040309 , @efriedma wrote: > If I'm understanding this correctly, the stack-safe metadata on allocas is > both produced and consumed at LTO-time. So at the point where the stack-safe > metadata would be produced, we

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-16 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. If I'm understanding this correctly, the stack-safe metadata on allocas is both produced and consumed at LTO-time. So at the point where the stack-safe metadata would be produced, we can compute whether any later passes will query it. Given that, why do you need a mo

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 264397. vitalybuka added a comment. module flag Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80046/new/ https://reviews.llvm.org/D80046 Files: clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CodeGe

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 264399. vitalybuka added a comment. typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80046/new/ https://reviews.llvm.org/D80046 Files: clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CodeGenModule

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 264398. vitalybuka added a comment. new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80046/new/ https://reviews.llvm.org/D80046 Files: clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CodeGenMo

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. > It could also be better, instead of iterating over all functions, simply run > the global pass, but make sure that it does not do too much work on > non-sanitize_memtag functions. I.e. the function pass should bail out on such > functions, and then the data flow wi

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Evgenii Stepanov via Phabricator via cfe-commits
eugenis added a comment. I think this is an OK approach. Perhaps a module flag would be even better, then it can be decoupled from "sanitize_memtag", and it would not require iterating over the entire module. You can check how it is used in CFI: !"CFI Canonical Jump Tables". It could also be be

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 264386. vitalybuka added a comment. pm test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80046/new/ https://reviews.llvm.org/D80046 Files: clang/lib/CodeGen/BackendUtil.cpp clang/test/Driver/memtag_lto

[PATCH] D80046: [StackSafety] Make full LTO to attach metadata if MTE is enabled

2020-05-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision. vitalybuka added a reviewer: eugenis. Herald added subscribers: llvm-commits, cfe-commits, dexonsmith, steven_wu, hiraditya, inglorion. Herald added projects: clang, LLVM. Depends on D80039 . Repository: rG LLVM Github Monorep