[PATCH] D36772: Unmerge GEPs to reduce register pressure on IndirectBr edges.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 18:45:32 PDT 2017


hfinkel added a comment.

> With this patch, the Python interpreter loop runs faster by ~5%.

On what platform?

Did you try always doing this (instead of just doing it over indirect branches)? You're possibly increasing the critical path by doing the computation this way, and if you have a processor with a good branch predictor maybe this shows up? But if you told me that it generally always helps, I'd not be too surprised either.

You should be careful not to create constants that aren't cheap to represent if you start with ones that are. Specifically, `UGEPIIdx->getValue() - GEPIIdx->getValue()` might be large (if one of those values is negative). TTI has getIntImmCost, and if both UIdx and Idx are cheap, but (Uidx - Idx) is expensive, we probably don't want to do this.


https://reviews.llvm.org/D36772





More information about the llvm-commits mailing list