[PATCH] D124997: [InstCombine] Fix scalable-vector bitwise select matching
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 5 08:40:54 PDT 2022
frasercrmck added a comment.
In D124997#3494017 <https://reviews.llvm.org/D124997#3494017>, @spatel wrote:
> We can still have a vector bitcast where the cast is to a type that matches the number of elements in the vector condition. That's the 2nd test IIUC, so if we just do the dyn_cast, it becomes:
>
> define <vscale x 1 x i64> @vec_of_casted_bools_scalable(<vscale x 1 x i64> %a, <vscale x 1 x i64> %b, <vscale x 8 x i1> %cond) {
> %1 = bitcast <vscale x 1 x i64> %a to <vscale x 8 x i8>
> %2 = bitcast <vscale x 1 x i64> %b to <vscale x 8 x i8>
> %3 = select <vscale x 8 x i1> %cond, <vscale x 8 x i8> %1, <vscale x 8 x i8> %2
> %4 = bitcast <vscale x 8 x i8> %3 to <vscale x 1 x i64>
> ret <vscale x 1 x i64> %4
> }
Oh, right you are! Sorry, I had the wrong impression of how this worked. Thank you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124997/new/
https://reviews.llvm.org/D124997
More information about the llvm-commits
mailing list