[llvm-bugs] [Bug 37420] New: new PM/SimpleLoopUnswitch 11% regression from old PM/LoopUnswitch

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 11 12:15:05 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37420

            Bug ID: 37420
           Summary: new PM/SimpleLoopUnswitch 11% regression from old
                    PM/LoopUnswitch
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: brzycki at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20293
  --> https://bugs.llvm.org/attachment.cgi?id=20293&action=edit
reduced C++ test-case

The new pass manager (-fexperimental-new-pass-manager) is showing an 11%
regression on a proprietary benchmark on Aarch64 (around 6% on x86_64).  Upon
further analysis the core of the problem is the SimpleLoopUnswitch code does
not catch a case the original LoopUnswitch code does. This check is very hot
and without this optiomization another ~40M instructions are executed inside
the hot region.

Attached is the reduced test-case (reduced.cpp).  To compile simply use:

good:
clang++ -O3 -emit-llvm -S reduced.cpp -o reduced_good.ll

bad:
clang++ -O3 -fexperimental-new-pass-manager -emit-llvm -S reduced.cpp -o
reduced_bad.ll

The successful case will have:

for.body.i.i.i.us:
...
  br i1 %cmp.i.i.i68.us, label %for.body.i.i.i.us, label
%_ZNK2JJ2paERK2EE.exit.loopexit.i

for.body.i.i.i:  
...
br i1 %cmp.i.i.i68, label %for.body.i.i.i, label
%_ZNK2JJ2paERK2EE.exit.loopexit.i

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180511/f4fc2047/attachment.html>


More information about the llvm-bugs mailing list