[PATCH] Reassociate in favor of grouping previously paired operands

Xuetian Weng xweng at google.com
Mon Jun 8 16:23:41 PDT 2015


Related discussion and original patch on llvmdev.

http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-May/085246.html

There are some differences between the original patch and this version:

1. Because OptimizeExpression has some assumptions about the order of linearized ops, in this version the order of operands is adjusted after calling function OptimizeExpression.
2. Because RewriteExprTree can only pair the last two operands in Ops, in this patch the order of operands is not adjusted by rank but by simply moving one pair of operands to the end of Ops.
3. Paired operands are indexed with their corresponding Opcode and Instruction. So (add a, b) will not make a, b together in a multiplication expression.
4. The pair will be discarded correctly in following case:
5. The corresponding instruction of the pair is removed.
6. The corresponding instruction of the pair is being linearized
7. Last pairing map is cleared after processing every basic block.


http://reviews.llvm.org/D10327

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list