[llvm] [GlobalIsel] Pust cast through build vector (PR #104634)

David Green via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 18 07:14:37 PDT 2024


Thorsten =?utf-8?q?Schütt?= <schuett at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/104634 at github.com>


davemgreen wrote:

Hi

@chuongg3 has been looking at something similar recently. It starts out with a patch that lowers buildvector to insert_elements in post-legalizer lowering, which helps make use of more isel patterns for things like lane-insert loads. That leads to some issues but we went through an explained all the ones that were getting worse. A number of them were other optimizations that were needed, and he is implementing one of them now.

That kind of does the opposite of this patch, operating on `buldvector(trunc, trunc, trunc, trunc)` where all the truncs come from a single `unmerge` (and there could be undef's), turning it back into `trunc(concat(..))` with a vector truncate. I believe what we found was that if there were two truncs it would be OK to leave it scalarized, but for 4+ the vector trunc is generally better so long as the inputs come from a vector.

https://github.com/llvm/llvm-project/pull/104634


More information about the llvm-commits mailing list