summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-05-12 14:52:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-05-12 14:52:22 +0000
commit5210141b07929221d7ea618a45889fd1c88519c7 (patch)
tree0744817bda1deff01d517435aa811b017b500e7f /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent5cc87e3ab3912a601fa33c7019f4284d141cee19 (diff)
downloadbcm5719-llvm-5210141b07929221d7ea618a45889fd1c88519c7.tar.gz
bcm5719-llvm-5210141b07929221d7ea618a45889fd1c88519c7.zip
Optimize orphan placement in a general way.
We used to place orphans by just using compareSectionsNonScript. Then we noticed that since linker scripts can use another order, we should first try match the section to a given PT_LOAD. But there is nothing special about PT_LOAD. The same issue can show up for PT_GNU_RELRO for example. In general, we have to search for the most similar section and put the orphan next to it. Most similar being defined as how long they follow the same code path in compareSecitonsNonScript. That is what this patch does. We now compute a rank for each output section, with a bit for each branch in what was compareSectionsNonScript. With this findOrphanPos is now fully general and orphan placement can be optimized by placing every section with the same rank at once. The included testcase is a variation of many-sections.s that uses allocatable sections to avoid the fast path in the existing code. Without threads it goes form 46 seconds to 0.9 seconds. llvm-svn: 302903
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud