diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2014-03-12 11:54:00 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2014-03-12 11:54:00 +0000 |
| commit | fe6bd52bf2ac280ef2ab6ed0d95563d100cd68cd (patch) | |
| tree | d094fc8b29cf83fd1e0361297cbf1f6c750b0c36 /lib/Transforms | |
| parent | d4517fa24da8d678e2541ec9b4def40b5b99753a (diff) | |
| download | llvm-fe6bd52bf2ac280ef2ab6ed0d95563d100cd68cd.tar.gz llvm-fe6bd52bf2ac280ef2ab6ed0d95563d100cd68cd.tar.bz2 llvm-fe6bd52bf2ac280ef2ab6ed0d95563d100cd68cd.tar.xz | |
[mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern.
Summary:
Correct the match patterns and the lowerings that made the CodeGen tests pass despite the mistakes.
The original testcase that discovered the problem was SingleSource/UnitTests/SignlessType/factor.c in test-suite.
During review, we also found that some of the existing CodeGen tests were incorrect and fixed them:
* bitwise.ll: In bsel_v16i8 the IfSet/IfClear were reversed because bsel and bmnz have different operand orders and the test didn't correctly account for this. bmnz goes 'IfClear, IfSet, CondMask', while bsel goes 'CondMask, IfClear, IfSet'.
* vec.ll: In the cases where a bsel is emitted as a bmnz (they are the same operation with a different input tied to the result) the operands were in the wrong order.
* compare.ll and compare_float.ll: The bsel operand order was correct for a greater-than comparison, but a greater-than comparison instruction doesn't exist. Lowering this operation inverts the condition so the IfSet/IfClear need to be swapped to match.
The differences between BSEL, BMNZ, and BMZ and how they map to/from vselect are rather confusing. I've therefore added a note to MSA.txt to explain this in a single place in addition to the comments that explain each case.
Reviewers: matheusalmeida, jacksprat
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3028
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
0 files changed, 0 insertions, 0 deletions
