HomePhabricator

[NFC][Codegen] Add better test coverage for potential add/sub constant folding

Description

[NFC][Codegen] Add better test coverage for potential add/sub constant folding

This adds hopefully-full test coverage for all the possible permutations:
First op is one of:

  • x + c1
  • x - c1
  • c1 - x

Second op is one of:

  • + c2
  • - c2
  • c2 -

And thus 3*3=9 patterns.
Some of them show missed constant-folds.

Without previous patch (the revert), these tests were causing endless
dagcombine loop. I really should have thought about this first :S

Details

Committed
lebedevriMay 30 2019, 9:07 AM
Parents
rL362109: [DAGCombine] Revert of recommit of "binop-with-const hoisting" patches
Branches
Unknown
Tags
Unknown