HomePhabricator

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

Authored by lebedev.ri on May 30 2019, 9:07 AM.

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

llvm-svn: 362110

Details

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