[llvm] [RISCV] Make InitUndef handle undef operand (PR #65755)
Piyou Chen via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 10 23:02:48 PDT 2023
BeMg wrote:
> Hi, if it's of any use to you I reduced the test case last night with llvm-reduce:
>
> ```llvm
> target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
> target triple = "riscv64-unknown-linux-gnu"
>
> ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
> declare <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8>, i64 immarg) #0
>
> ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
> declare <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8>, <16 x i8>, i64 immarg) #0
>
> ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
> declare <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8>, <vscale x 8 x i8>, i64, i64, i64 immarg) #1
>
> define void @foo(<vscale x 8 x i8> %0) #2 {
> %2 = tail call <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8> undef, <16 x i8> undef, i64 0)
> %3 = tail call <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8> undef, <16 x i8> poison, i64 0)
> br label %4
>
> 4: ; preds = %4, %1
> %5 = tail call <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8> zeroinitializer, <vscale x 8 x i8> %2, i64 0, i64 0, i64 0)
> %6 = tail call <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8> %5, i64 0)
> %7 = bitcast <16 x i8> %6 to <2 x i64>
> %8 = extractelement <2 x i64> %7, i64 0
> %9 = insertvalue [2 x i64] zeroinitializer, i64 %8, 0
> %10 = tail call <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8> %0, <vscale x 8 x i8> %3, i64 0, i64 0, i64 0)
> %11 = tail call <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8> %10, i64 0)
> %12 = bitcast <16 x i8> %11 to <2 x i64>
> %13 = extractelement <2 x i64> %12, i64 0
> %14 = insertvalue [2 x i64] zeroinitializer, i64 %13, 0
> %15 = tail call fastcc [2 x i64] null([2 x i64] %9, [2 x i64] %14, [2 x i64] zeroinitializer)
> br label %4
> }
>
> attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
> attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
> attributes #2 = { "target-features"="+64bit,+a,+d,+f,+m,+relax,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-c,-e,-h,-save-restore,-svinval,-svnapot,-svpbmt,-unaligned-scalar-mem,-unaligned-vector-mem,-xcvalu,-xcvbi,-xcvbitmanip,-xcvmac,-xcvsimd,-xsfcie,-xsfvcp,-xventanacondops,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmp,-zcmt,-zdinx,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zicbom,-zicbop,-zicboz,-zicntr,-zihintntl,-zihintpause,-zihpm,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-zmmul,-zvfh,-zvl1024b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl4096b,-zvl512b,-zvl65536b,-zvl8192b" }
> ```
Thanks, very helpful!
https://github.com/llvm/llvm-project/pull/65755
More information about the llvm-commits
mailing list