non-vectorizable-intrinsic.ll 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ; RUN: opt < %s -slp-vectorizer -o - -S -slp-threshold=-1000
  2. target datalayout = "e-p:32:32-i64:64-v16:16-v32:32-n16:32:64"
  3. target triple = "nvptx--nvidiacl"
  4. ; CTLZ cannot be vectorized currently because the second argument is a scalar
  5. ; for both the scalar and vector forms of the intrinsic. In the future it
  6. ; should be possible to vectorize such functions.
  7. ; Test causes an assert if LLVM tries to vectorize CTLZ.
  8. define <2 x i8> @cltz_test(<2 x i8> %x) #0 {
  9. entry:
  10. %0 = extractelement <2 x i8> %x, i32 0
  11. %call.i = call i8 @llvm.ctlz.i8(i8 %0, i1 false)
  12. %vecinit = insertelement <2 x i8> undef, i8 %call.i, i32 0
  13. %1 = extractelement <2 x i8> %x, i32 1
  14. %call.i4 = call i8 @llvm.ctlz.i8(i8 %1, i1 false)
  15. %vecinit2 = insertelement <2 x i8> %vecinit, i8 %call.i4, i32 1
  16. ret <2 x i8> %vecinit2
  17. }
  18. define <2 x i8> @cltz_test2(<2 x i8> %x) #1 {
  19. entry:
  20. %0 = extractelement <2 x i8> %x, i32 0
  21. %1 = extractelement <2 x i8> %x, i32 1
  22. %call.i = call i8 @llvm.ctlz.i8(i8 %0, i1 false)
  23. %call.i4 = call i8 @llvm.ctlz.i8(i8 %1, i1 false)
  24. %vecinit = insertelement <2 x i8> undef, i8 %call.i, i32 0
  25. %vecinit2 = insertelement <2 x i8> %vecinit, i8 %call.i4, i32 1
  26. ret <2 x i8> %vecinit2
  27. }
  28. declare i8 @llvm.ctlz.i8(i8, i1) #3
  29. attributes #0 = { alwaysinline nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
  30. attributes #1 = { nounwind readnone }