[all-commits] [llvm/llvm-project] ec1445: [X86] Fix for ballooning compile times due to Load...

Scott Constable via All-commits all-commits at lists.llvm.org
Thu Jul 30 17:44:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ec1445c5afda7f145a414f11c9103c87a4c1823f
      https://github.com/llvm/llvm-project/commit/ec1445c5afda7f145a414f11c9103c87a4c1823f
  Author: Scott Constable <scott.d.constable at intel.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp

  Log Message:
  -----------
  [X86] Fix for ballooning compile times due to Load Value Injection (LVI) mitigations

Fix for the issue raised in https://github.com/rust-lang/rust/issues/74632.

The current heuristic for inserting LFENCEs uses a quadratic-time algorithm. This can apparently cause substantial compilation slowdowns for building Rust projects, where functions > 5000 LoC are apparently common.

The updated heuristic in this patch implements a linear-time algorithm. On a set of benchmarks, the slowdown factor for the generated code was comparable (2.55x geo mean for the quadratic-time heuristic, vs. 2.58x for the linear-time heuristic). Both heuristics offer the same security properties, namely, mitigating LVI.

This patch also includes some formatting fixes.

Differential Revision: https://reviews.llvm.org/D84471




More information about the All-commits mailing list