[PATCH] D145301: Add more efficient vector bitcast for AArch64

Markus Everling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 25 09:54:29 PDT 2023


Sp00ph added a comment.

I unfortunately have barely any experience with LLVM internals and its codebase, so I probably won't be of too much help here. I believe that the main culprit behind the bad codegen are load/store operations on vectors whose elements are smaller than one byte. From what I understand, bitcasts most of the time get lowered to `alloca; store as SrcType; load as DstType`, and the loads/stores are fully scalarized for 1 bit elements. So optimizing the loads/stores would then probably also fix the bitcasts as a byproduct. If I'm not mistaken, the locations to introduce the store/load optimizations would be here: https://github.com/llvm/llvm-project/blob/cb96eba27cd18ecf8041bf1b9a5c7e197f7a2749/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp#L6236 and here: https://github.com/llvm/llvm-project/blob/cb96eba27cd18ecf8041bf1b9a5c7e197f7a2749/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp#L5148


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145301



More information about the llvm-commits mailing list