[PATCH] D80064: [X86] Disable LVI load hardening pass at O0
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 27 11:56:26 PDT 2020
craig.topper added a comment.
In D80064#2056188 <https://reviews.llvm.org/D80064#2056188>, @sconstab wrote:
> In D80064#2041175 <https://reviews.llvm.org/D80064#2041175>, @jethrogb wrote:
>
> > In D80064#2040163 <https://reviews.llvm.org/D80064#2040163>, @sconstab wrote:
> >
> > > I can accept this change if the driver can also emit a warning when LVI hardening is enabled with `-O0`. We already have a similar warning when LVI CFI protections are enabled with retpoline. The warning is emitted in clang/lib/Driver/ToolChains/Arch/X86.cpp.
> >
> >
> > IIUC, this warning triggers only on particular command-line settings. However, the pass is activated by a function attribute, which may be enabled in different ways. **I think there should be a warning if there is any function with the attribute but the pass not enabled.**
>
>
> Is there a way to do this in TargetMachine.cpp? The pass is inserted into the `X86PassConfig`. Is the module accessible at this point?
I don't think so. The only thought I have is to add an O0 version of the pass that just errors. Or maybe does something simple like fence every load.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80064/new/
https://reviews.llvm.org/D80064
More information about the llvm-commits
mailing list