[PATCH] D152245: [AArch64] Add tablegen patterns for faddp of two extracts

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 08:49:04 PDT 2023


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.td:8501
+// faddp extractlow(Rn), extracthigh(Rn)
+def : Pat<(AArch64faddp (extract_subvector (v4f32 FPR128:$Rn), (i64 0)),
+                        (extract_subvector (v4f32 FPR128:$Rn), (i64 2))),
----------------
david-arm wrote:
> Hi @dmgreen, apologies for the drive-by comment, but I wonder if this needs a return type from `extract_subvector` in case it attempts to match the wrong subvector type? For example, in theory this may attempt to match
> 
>   AArch64faddp (v1i32 extract_subvector (v4f32 FPR128:$Rn), (i64 0)),
>                           (v1i32 extract_subvector (v4f32 FPR128:$Rn), (i64 2)))
> 
> as well as the pattern I presume you actually want to match, which is
> 
>   AArch64faddp (v2i32 extract_subvector (v4f32 FPR128:$Rn), (i64 0)),
>                           (v2i32 extract_subvector (v4f32 FPR128:$Rn), (i64 2)))
> 
> ?
Sorry I apparently missed this. v1f32 is neither a legal type, nor a valid input to AArch64faddp. I'm pretty sure that the only type this can be would be a v2f32. I can add them if you think it's better to be careful, but I don't believe it is necessary. Let me know if you think otherwise.


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

https://reviews.llvm.org/D152245



More information about the llvm-commits mailing list