https://llvm.org/bugs/show_bug.cgi?id=26055
Bug ID: 26055 Summary: LiveDebugValues is very slow Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Common Code Generator Code Assignee: vikram.tarik...@gmail.com Reporter: vonos...@gmail.com CC: apra...@apple.com, dber...@dberlin.org, dblai...@gmail.com, llvm-bugs@lists.llvm.org Classification: Unclassified LiveDebugValues pass re-committed in r255759 is slow on large functions with lots of local variables and basic blocks. This often happens if one is using "-O2 -fsanitize=address -g" (first flag causes a lot of inlining, while ASan adds a number of non-trivial basic blocks). Attached is a reproducer created from OpenCV 2.2.0: $ ./bin/llc -filetype=obj a.ll takes forever, and the time is spent in this pass: 46.42% llc llc [.] (anonymous namespace)::LiveDebugValues::VarLoc::operator==((anonymous namespace)::LiveDebugValues::VarLoc const&) const 20.04% llc llc [.] (anonymous namespace)::LiveDebugValues::transfer(llvm::MachineInstr&, std::list<(anonymous namespace)::LiveDebugValues::VarLoc, std::allocator<(anonymous namespace)::LiveDeb 11.14% llc llc [.] bool __gnu_cxx::__ops::_Iter_pred<(anonymous namespace)::LiveDebugValues::transferRegisterDef(llvm::MachineInstr&, std::list<(anonymous namespace)::LiveDebugValues::VarLoc, 9.74% llc llc [.] (anonymous namespace)::LiveDebugValues::runOnMachineFunction(llvm::MachineFunction&) Note that some functions are wildly inefficient: e.g. transferTerminatorInst appends one list to another in O(n^2) time. It looks like at least in some cases it would be beneficial to replace lists with hash maps. I've created a patch to do so, but the compile time was huge anyway. Also, do you have an estimate on the total number of times you will consider a single machine instruction? (as you can scan the same MBB several times). Currently there's no way to disable this pass: could you consider adding an option to switch it on/off, or disabling it while working on speeding it up? -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs