[PATCH] D21183: Better selection of common base address in constant hoisting
Sjoerd Meijer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 09:32:22 PDT 2016
SjoerdMeijer updated this revision to Diff 62887.
SjoerdMeijer added a comment.
Sorry for the delay (this work was interrupted by my holiday and some other work).
Compared to the previous patch, this are the changes:
- It still affects all targets, but the code triggers only at –Os
- We have traded readability/maintainability of the algorithm over efficiency. So it is now less efficient, but a simple check that sees if the list contains more than 100 items in the worklist makes the code fall back to the old algorithm. The algorithm is also slightly different as it sums up the costs of all uses and then subtracts values for offsets that are out of range; before we were not really tracking the costs of all uses.
- For X86 I have checked that the behaviour is the same as the old algorithm for the LNT suite.
- I don’t see any regressions for aarch32 thumb mode on LNT, coremark, dhrystone, eembc, but no improvements either. Our motivating example still sees the significant code size reduction though.
- I still do need an extra callback to get the costs for offsets. The reasons is that the existing getIntImmCosts functions checks which subtarget is being targeted. This doesn’t help because we want to know the costs of an immediate in a different ISA (i.e. thumb1).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10000 bytes
Desc: not available
More information about the llvm-commits