[PATCH] D21299: [Codegen Prepare] Swap commutative binops before splitting branch condition.
Balaram Makam via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 08:24:39 PDT 2016
bmakam added a comment.
In principle, this change is target independent because it reassociates binary operands to simplify branches. The reassociation pass is designed for transformations that will help down the line optimizations such as constant propagation, GCSE, LICM, PRE etc.. so I moved it down to CGP.
I can certainly verify for A57 and know for a fact that it improves spec2006/mcf on A57 as well. However, I am uncertain of reliably testing and verifying on other targets.
If we want to move this to AArch64 backend only, this needs to be done at pre-ISel stage. AArch64PromoteConstantPass and Arch64AddressTypePromotionPass are the only pre-ISel passes in AArch64 backend but their purpose is different to what this change tries to accomplish. I'm not sure if it is reasonable to create another pass just to do this transformation.
http://reviews.llvm.org/D21299
More information about the llvm-commits
mailing list