vectors-with-mismatched-elements.ll 1003 B

123456789101112131415161718192021222324252627
  1. ; RUN: opt -scalarrepl -S < %s | FileCheck %s
  2. ; rdar://9786827
  3. ; SROA should be able to handle the mixed types and eliminate the allocas here.
  4. ; TODO: Currently it does this by falling back to integer "bags of bits".
  5. ; With enough cleverness, it should be possible to convert between <3 x i32>
  6. ; and <2 x i64> by using a combination of a bitcast and a shuffle.
  7. ; CHECK: {
  8. ; CHECK-NOT: alloca
  9. ; CHECK: }
  10. target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
  11. target triple = "i386-apple-darwin11.0.0"
  12. define <2 x i64> @foo() nounwind {
  13. entry:
  14. %retval = alloca <3 x i32>, align 16
  15. %z = alloca <4 x i32>, align 16
  16. %tmp = load <4 x i32>, <4 x i32>* %z
  17. %tmp1 = shufflevector <4 x i32> %tmp, <4 x i32> undef, <3 x i32> <i32 0, i32 1, i32 2>
  18. store <3 x i32> %tmp1, <3 x i32>* %retval
  19. %0 = bitcast <3 x i32>* %retval to <2 x i64>*
  20. %1 = load <2 x i64>, <2 x i64>* %0, align 1
  21. ret <2 x i64> %1
  22. }