This is an archive of the discontinued LLVM Phabricator instance.

[mips] Handle missing CondCodes
ClosedPublic

Authored by smaksimovic on Aug 15 2018, 1:54 AM.

Details

Summary

Add patterns for unhandled CondCode enumerables:
SETEQ, SETGE, SETGT, SETLE, SETLT, SETNE.

Stated at the ISD::CondCode enum declaration:
All of these (except for the 'always folded ops') should be handled for floating point.

Since the introduction of D46854, a simple example

define  double @test(<2 x double>) unnamed_addr {
start:
  %1 = call double @llvm.experimental.vector.reduce.fmin.f64.v2f64(<2 x double> %0)
  ret double %1
}

fails due to
v2i64 = setcc t6, t19, setlt:ch
not being matchable, which previously held a setolt condition code node.

Add patterns which use these nodes, same as corresponding 'ordered' CondCode nodes.
Referring to Ordered means that neither operand is a QNAN we assume it is safe to match ex. SETLT node to the same
instruction as SETOLT.

Diff Detail

Repository
rL LLVM

Event Timeline

smaksimovic created this revision.Aug 15 2018, 1:54 AM

Add test file.

atanasyan added inline comments.Aug 20 2018, 4:03 AM
test/CodeGen/Mips/msa/cc_without_nan.ll
15 ↗(On Diff #160809)

What do you think about extending this test case to cover more new patterns?

Update test file to cover all of the patterns included in the change.

smaksimovic added inline comments.Aug 21 2018, 2:22 AM
test/CodeGen/Mips/msa/cc_without_nan.ll
15 ↗(On Diff #160809)

Thanks for noticing, I had completely missed that part.
Updated.

This revision is now accepted and ready to land.Aug 21 2018, 3:10 AM
This revision was automatically updated to reflect the committed changes.