known_align.ll 1.0 KB

123456789101112131415161718192021222324252627
  1. ; RUN: opt < %s -instcombine -S | grep "align 1"
  2. ; END.
  3. %struct.p = type <{ i8, i32 }>
  4. @t = global %struct.p <{ i8 1, i32 10 }> ; <%struct.p*> [#uses=1]
  5. @u = weak global %struct.p zeroinitializer ; <%struct.p*> [#uses=1]
  6. define i32 @main() {
  7. entry:
  8. %retval = alloca i32, align 4 ; <i32*> [#uses=2]
  9. %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
  10. %tmp1 = alloca i32, align 4 ; <i32*> [#uses=3]
  11. %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
  12. %tmp3 = load i32, i32* getelementptr (%struct.p, %struct.p* @t, i32 0, i32 1), align 1 ; <i32> [#uses=1]
  13. store i32 %tmp3, i32* %tmp1, align 4
  14. %tmp5 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1]
  15. store i32 %tmp5, i32* getelementptr (%struct.p, %struct.p* @u, i32 0, i32 1), align 1
  16. %tmp6 = load i32, i32* %tmp1, align 4 ; <i32> [#uses=1]
  17. store i32 %tmp6, i32* %tmp, align 4
  18. %tmp7 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1]
  19. store i32 %tmp7, i32* %retval, align 4
  20. br label %return
  21. return: ; preds = %entry
  22. %retval8 = load i32, i32* %retval ; <i32> [#uses=1]
  23. ret i32 %retval8
  24. }