[all-commits] [llvm/llvm-project] 7acfda: [llvm] Make new pass manager's OptimizationLevel a...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Thu Jan 16 09:01:07 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7acfda633f1378344efde22bfed242dd56c26cdd
      https://github.com/llvm/llvm-project/commit/7acfda633f1378344efde22bfed242dd56c26cdd
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M llvm/include/llvm/Passes/PassBuilder.h
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
    A llvm/test/Transforms/LoopUnroll/opt-levels.ll
    A llvm/test/Transforms/LoopUnrollAndJam/opt-levels.ll

  Log Message:
  -----------
  [llvm] Make new pass manager's OptimizationLevel a class

Summary:
The old pass manager separated speed optimization and size optimization
levels into two unsigned values. Coallescing both in an enum in the new
pass manager may lead to unintentional casts and comparisons.

In particular, taking a look at how the loop unroll passes were constructed
previously, the Os/Oz are now (==new pass manager) treated just like O3,
likely unintentionally.

This change disallows raw comparisons between optimization levels, to
avoid such unintended effects. As an effect, the O{s|z} behavior changes
for loop unrolling and loop unroll and jam, matching O2 rather than O3.

The change also parameterizes the threshold values used for loop
unrolling, primarily to aid testing.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: zzheng, ychen, mehdi_amini, hiraditya, steven_wu, dexonsmith, dang, cfe-commits, llvm-commits

Tags: #clang, #llvm

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




More information about the All-commits mailing list