[LLVMbugs] [Bug 23077] New: LICM seems unnecessarily slow

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 30 15:42:15 PDT 2015


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

            Bug ID: 23077
           Summary: LICM seems unnecessarily slow
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: tobias at grosser.es
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14121
  --> https://llvm.org/bugs/attachment.cgi?id=14121&action=edit
Test case

This simple file takes with 'opt -basicaa -licm out.opt.ll' 130ms to run. This
is suprisingly slow.

If I comment out the following lines:

     // If there are any call sites in the alias set, add them to this AST.
-    for (unsigned i = 0, e = AS.UnknownInsts.size(); i != e; ++i)
-      add(AS.UnknownInsts[i]);
+    //for (unsigned i = 0, e = AS.UnknownInsts.size(); i != e; ++i)
+    //  add(AS.UnknownInsts[i]);

Compile time is reduced to 20ms.

Surisingly only a single test case fails:

    Transforms/LICM/PR21582.ll

I do not yet understand well what these Unknown instructions are suppose to be
used for, but I somehow have the feeling there is an obvious inefficiency here.

If I dump the AST:

+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -200,6 +200,7 @@ bool LICM::runOnLoop(Loop *L, LPPassManager &LPM) {
     delete InnerAST;
     LoopToAliasSetMap.erase(InnerL);
   }
+  CurAST->dump();

I get(after some delay) the following output:

Alias Set Tracker: 128 alias sets for 0 pointer values.
  AliasSet[0x454de10, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>
  AliasSet[0x454de60, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>
  AliasSet[0x454deb0, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>
  AliasSet[0x454df20, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>
  AliasSet[0x454df90, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>
  AliasSet[0x454e000, 1] may alias, Mod/Ref   
    1 Unknown instructions: void <badref>

...

Do we really need 128 alias sets here?

-- 
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/20150330/a92e18e4/attachment.html>


More information about the llvm-bugs mailing list