[NFC][Codegen] Add better test coverage for potential add/sub constant folding
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 16:07:19 +0000 (16:07 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 16:07:19 +0000 (16:07 +0000)
commit700fdb10706186a464cc86b8c1fae0cd778a449d
tree0ef0f1c08fe3ffa0a4f2a6ab0c6b8cf995787157
parent019d270e43967558de00ee4b6d624a2225a2fb77
[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
llvm/test/CodeGen/AArch64/addsub-constant-folding.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/vec_add.ll [deleted file]
llvm/test/CodeGen/X86/addsub-constant-folding.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/vec_add.ll [deleted file]