-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
define dso_local <2 x i64> @foo(<2 x i64> %0, <2 x i64> %1) local_unnamed_addr {
Entry:
%2 = trunc <2 x i64> %1 to <2 x i6>
%3 = sub <2 x i6> zeroinitializer, %2
%4 = zext <2 x i6> %3 to <2 x i64>
%5 = shl <2 x i64> %0, %4
%6 = and <2 x i64> %1, splat (i64 63)
%7 = lshr <2 x i64> %0, %6
%8 = or <2 x i64> %5, %7
ret <2 x i64> %8
}
define dso_local <4 x i64> @bar(<4 x i64> %0, <4 x i64> %1) local_unnamed_addr {
Entry:
%2 = trunc <4 x i64> %1 to <4 x i6>
%3 = sub <4 x i6> zeroinitializer, %2
%4 = zext <4 x i6> %3 to <4 x i64>
%5 = shl <4 x i64> %0, %4
%6 = and <4 x i64> %1, splat (i64 63)
%7 = lshr <4 x i64> %0, %6
%8 = or <4 x i64> %5, %7
ret <4 x i64> %8
}
define dso_local <8 x i64> @baz(<8 x i64> %0, <8 x i64> %1) local_unnamed_addr {
Entry:
%2 = trunc <8 x i64> %1 to <8 x i6>
%3 = sub <8 x i6> zeroinitializer, %2
%4 = zext <8 x i6> %3 to <8 x i64>
%5 = shl <8 x i64> %0, %4
%6 = and <8 x i64> %1, splat (i64 63)
%7 = lshr <8 x i64> %0, %6
%8 = or <8 x i64> %5, %7
ret <8 x i64> %8
}Emit:
foo:
vprorvq xmm0, xmm0, xmm1
ret
.LCPI1_0:
.quad 63
bar:
vpbroadcastq ymm4, qword ptr [rip + .LCPI1_0]
vpmovqd xmm2, ymm1
vpxor xmm3, xmm3, xmm3
vpsubd xmm2, xmm3, xmm2
vpmovzxdq ymm2, xmm2
vpand ymm2, ymm2, ymm4
vpand ymm1, ymm1, ymm4
vpsllvq ymm2, ymm0, ymm2
vpsrlvq ymm0, ymm0, ymm1
vpor ymm0, ymm2, ymm0
ret
.LCPI2_0:
.quad 63
baz:
vpmovqw xmm2, zmm1
vpbroadcastq zmm4, qword ptr [rip + .LCPI2_0]
vpxor xmm3, xmm3, xmm3
vpsubw xmm2, xmm3, xmm2
vpmovzxwq zmm2, xmm2
vpandq zmm1, zmm1, zmm4
vpandq zmm2, zmm2, zmm4
vpsllvq zmm2, zmm0, zmm2
vpsrlvq zmm0, zmm0, zmm1
vporq zmm0, zmm2, zmm0
retMetadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization