[PATCH] D158386: [AArch64][SME] Promote mask for masked load to a similar type size with load value.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 01:41:16 PDT 2023


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:24966
 
-  SDValue Mask = convertFixedMaskToScalableVector(Load->getMask(), DAG);
+  SDValue MaskOrig = Load->getMask();
+  if (VT.getSizeInBits() != Load->getMask().getValueType().getSizeInBits()) {
----------------
It is better to just call this `Mask`, because you're overwriting the "original" value of Mask with an extended version, so `MaskOrig` is a misnomer.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:24967
+  SDValue MaskOrig = Load->getMask();
+  if (VT.getSizeInBits() != Load->getMask().getValueType().getSizeInBits()) {
+    assert(VT.getSizeInBits() > MaskOrig.getValueType().getSizeInBits()
----------------
Given that the number of elements between VT and the predicate mask should match, this can compare the size of element type directly (as opposed to comparing the size of the whole vector).


================
Comment at: llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-masked-load.ll:459
+
+attributes #0 = { "aarch64_pstate_sm_body" "target-features"="+sve,+sme" }
----------------
This attribute is unnecessary for the test. The important thing is that this function is compiled for 'streaming-compatible SVE', which is already enforced by the flag passed to `llc`.


================
Comment at: llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-masked-load.ll:459
+
+attributes #0 = { "aarch64_pstate_sm_body" "target-features"="+sve,+sme" }
----------------
sdesmalen wrote:
> This attribute is unnecessary for the test. The important thing is that this function is compiled for 'streaming-compatible SVE', which is already enforced by the flag passed to `llc`.
`+sme` is also not necessary for this test.


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

https://reviews.llvm.org/D158386



More information about the llvm-commits mailing list