Skip to content

Commit

Permalink
[AArch64][SME]: Generate streaming-compatible code for fp-compares.
Browse files Browse the repository at this point in the history
To generate code compatible to streaming mode:
 - enable expanding ISD::SETUEQ to avoid custom-lowering setcc to setcc_merge_zero
   which cause a crash while instruction selection because there is no pattern match for it.

- Testing files:
 - fp-compares.ll

Differential Revision: https://reviews.llvm.org/D138670
  • Loading branch information
hassnaaHamdi committed Nov 28, 2022
1 parent 2cb02f2 commit 60ab791
Show file tree
Hide file tree
Showing 2 changed files with 671 additions and 2 deletions.
13 changes: 11 additions & 2 deletions llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Expand Up @@ -1658,6 +1658,17 @@ void AArch64TargetLowering::addTypeForStreamingSVE(MVT VT) {
setOperationAction(ISD::FROUND, VT, Custom);
setOperationAction(ISD::FROUNDEVEN, VT, Custom);
setOperationAction(ISD::FTRUNC, VT, Custom);
if (VT.isFloatingPoint()) {
setCondCodeAction(ISD::SETO, VT, Expand);
setCondCodeAction(ISD::SETOLT, VT, Expand);
setCondCodeAction(ISD::SETOLE, VT, Expand);
setCondCodeAction(ISD::SETULT, VT, Expand);
setCondCodeAction(ISD::SETULE, VT, Expand);
setCondCodeAction(ISD::SETUGE, VT, Expand);
setCondCodeAction(ISD::SETUGT, VT, Expand);
setCondCodeAction(ISD::SETUEQ, VT, Expand);
setCondCodeAction(ISD::SETONE, VT, Expand);
}
}

void AArch64TargetLowering::addTypeForFixedLengthSVE(MVT VT) {
Expand All @@ -1673,9 +1684,7 @@ void AArch64TargetLowering::addTypeForFixedLengthSVE(MVT VT) {
if (VT.isFloatingPoint()) {
setCondCodeAction(ISD::SETO, VT, Expand);
setCondCodeAction(ISD::SETOLT, VT, Expand);
setCondCodeAction(ISD::SETLT, VT, Expand);
setCondCodeAction(ISD::SETOLE, VT, Expand);
setCondCodeAction(ISD::SETLE, VT, Expand);
setCondCodeAction(ISD::SETULT, VT, Expand);
setCondCodeAction(ISD::SETULE, VT, Expand);
setCondCodeAction(ISD::SETUGE, VT, Expand);
Expand Down

0 comments on commit 60ab791

Please sign in to comment.