[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
authorAlexey Bataev <a.bataev@hotmail.com>
Mon, 11 Jan 2016 11:52:29 +0000 (11:52 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Mon, 11 Jan 2016 11:52:29 +0000 (11:52 +0000)
commita14bfb5ac370b4198295c35ab5b8d3e06bc5758e
treecccac61a4ad96e41e5e79dcc3413e9eb102e1726
parentf7566237848be2bd3276d1445da5ab5ebc5a359e
[X86] Reduce complexity of the LEA optimization pass, by Andrey Turetsky.
In the OptimizeLEA pass keep instructions' positions in the basic block saved and use them for calculation of the distance between two instructions instead of std::distance. This reduces complexity of the pass from O(n^3) to O(n^2) and thus the compile time.
Differential Revision: http://reviews.llvm.org/D15692

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257328 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86OptimizeLEAs.cpp