Home | History | Annotate | Download | only in llvm2ice_tests
      1 ; This test is lowered from C code that does some simple aritmetic
      2 ; with struct members.
      3 
      4 ; REQUIRES: allow_dump
      5 ; RUN: %p2i -i %s --args --verbose inst -threads=0 | FileCheck %s
      6 
      7 define internal i32 @compute_important_function(i32 %v1, i32 %v2) {
      8 entry:
      9   %__2 = inttoptr i32 %v1 to i32*
     10   %_v0 = load i32, i32* %__2, align 1
     11 
     12 ; CHECK:        entry:
     13 ; CHECK-NEXT:       %_v0 = load i32, i32* {{.*}}, align 1
     14 
     15   %__4 = inttoptr i32 %v2 to i32*
     16   %_v1 = load i32, i32* %__4, align 1
     17   %gep = add i32 %v2, 12
     18   %__7 = inttoptr i32 %gep to i32*
     19   %_v2 = load i32, i32* %__7, align 1
     20   %mul = mul i32 %_v2, %_v1
     21   %gep6 = add i32 %v1, 4
     22   %__11 = inttoptr i32 %gep6 to i32*
     23   %_v3 = load i32, i32* %__11, align 1
     24   %gep8 = add i32 %v2, 8
     25   %__14 = inttoptr i32 %gep8 to i32*
     26   %_v4 = load i32, i32* %__14, align 1
     27   %gep10 = add i32 %v2, 4
     28   %__17 = inttoptr i32 %gep10 to i32*
     29   %_v5 = load i32, i32* %__17, align 1
     30   %mul3 = mul i32 %_v5, %_v4
     31   %gep12 = add i32 %v1, 8
     32   %__21 = inttoptr i32 %gep12 to i32*
     33   %_v6 = load i32, i32* %__21, align 1
     34   %mul7 = mul i32 %_v6, %_v3
     35   %mul9 = mul i32 %mul7, %_v6
     36   %gep14 = add i32 %v1, 12
     37   %__26 = inttoptr i32 %gep14 to i32*
     38   %_v7 = load i32, i32* %__26, align 1
     39   %mul11 = mul i32 %mul9, %_v7
     40   %add4.neg = add i32 %mul, %_v0
     41   %add = sub i32 %add4.neg, %_v3
     42   %sub = sub i32 %add, %mul3
     43   %sub12 = sub i32 %sub, %mul11
     44   ret i32 %sub12
     45 
     46 ; CHECK:        %sub12 = sub i32 %sub, %mul11
     47 ; CHECK-NEXT:       ret i32 %sub12
     48 }
     49