[PATCH] D71556: [AArch64][SVE] Implement intrinsic for non-faulting loads

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 03:10:11 PST 2019


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.td:329
+
+def non_faulting_load :
+   PatFrag<(ops node:$ptr, node:$pred, node:$def),
----------------
This duplicates a lot of code, maybe it makes sense to combine this into a multiclass. I'm thinking of something along the lines of:
```
multiclass load_store_fragments<code pred> {
  def : PatFrag<(ops node:$ptr, node:$pred, node:$def),
                (masked_ld node:$ptr, undef, node:$pred, node:$def),
                pred>;

  def _i8 : PatFrag<(ops ...),
                    ((cast<SDPatternOperator>(NAME) ...),
                    [{ return cast<MaskedLoadSDNode>(N)->getMemoryVT().getScalarType() == MVT::i8; }]>;
  def _i16 : PatFrag<(ops ...),
                    ((cast<SDPatternOperator>(NAME) ....),
                    [{ return cast<MaskedLoadSDNode>(N)->getMemoryVT().getScalarType() == MVT::i16; }]>;
  def _i32 : PatFrag<(ops ...),
                    ((cast<SDPatternOperator>(NAME) ....),
                    [{ return cast<MaskedLoadSDNode>(N)->getMemoryVT().getScalarType() == MVT::i32; }]>;
  def _i64 : PatFrag<(ops ...),
                    ((cast<SDPatternOperator>(NAME) ....),
                    [{ return cast<MaskedLoadSDNode>(N)->getMemoryVT().getScalarType() == MVT::i64; }]>;
}

defm non_temporal_load : load_store_fragments<[{
   return cast<MaskedLoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD &&
          cast<MaskedLoadSDNode>(N)->isUnindexed() &&
          cast<MaskedLoadSDNode>(N)->isNonTemporal() &&
          !cast<MaskedLoadSDNode>(N)->isNonFaulting();
}]>;

defm sext_non_temporal_load : load_store_fragments<[{
   return cast<MaskedLoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD &&
          cast<MaskedLoadSDNode>(N)->isUnindexed() &&
          cast<MaskedLoadSDNode>(N)->isNonTemporal() &&
          !cast<MaskedLoadSDNode>(N)->isNonFaulting();
}]>;

defm zext_non_faulting_load : load_store_fragments<[{
   return cast<MaskedLoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD &&
          cast<MaskedLoadSDNode>(N)->isUnindexed() &&
          !cast<MaskedLoadSDNode>(N)->isNonTemporal() &&
          cast<MaskedLoadSDNode>(N)->isNonFaulting();
}]>;
```


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.td:338
+
+def sext_non_faulting_load :
+  PatFrag<(ops node:$ptr, node:$pred, node:$def),
----------------
nit: we should probably add `_masked_` to the name (although I realise that I forgot to spot that on the non-temporal patch)


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.td:341
+          (masked_ld node:$ptr, undef, node:$pred, node:$def), [{
+  return cast<MaskedLoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD &&
+         cast<MaskedLoadSDNode>(N)->isUnindexed() &&
----------------
Shall we support any-extend as well? (thus making `asext_non_faulting_load`)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71556/new/

https://reviews.llvm.org/D71556





More information about the llvm-commits mailing list