[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction

One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.

This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.

* This doesn't modify gep operators, only instructions (operators will be
  handled separately)

* Textual IR changes only. Bitcode (including upgrade) and changing the
  in-memory representation will be in separate changes.

* geps of vectors are transformed as:
    getelementptr <4 x float*> %x, ...
  ->getelementptr float, <4 x float*> %x, ...
  Then, once the opaque pointer type is introduced, this will ultimately look
  like:
    getelementptr float, <4 x ptr> %x
  with the unambiguous interpretation that it is a vector of pointers to float.

* address spaces remain on the pointer, not the type:
    getelementptr float addrspace(1)* %x
  ->getelementptr float, float addrspace(1)* %x
  Then, eventually:
    getelementptr float, ptr addrspace(1) %x

Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.

update.py:
import fileinput
import sys
import re

ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile(       r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")

def conv(match, line):
  if not match:
    return line
  line = match.groups()[0]
  if len(match.groups()[5]) == 0:
    line += match.groups()[2]
  line += match.groups()[3]
  line += ", "
  line += match.groups()[1]
  line += "\n"
  return line

for line in sys.stdin:
  if line.find("getelementptr ") == line.find("getelementptr inbounds"):
    if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
      line = conv(re.match(ibrep, line), line)
  elif line.find("getelementptr ") != line.find("getelementptr ("):
    line = conv(re.match(normrep, line), line)
  sys.stdout.write(line)

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).

The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.

Reviewers: rafael, dexonsmith, grosser

Differential Revision: http://reviews.llvm.org/D7636

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-02-27 19:29:02 +00:00
parent 56f3b7f2fd
commit 198d8baafb
2277 changed files with 41849 additions and 41819 deletions

View File

@@ -75,22 +75,22 @@ entry:
]
bb: ; preds = %entry
%0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1]
%0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1]
%1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=1]
ret %struct.quad_struct* %1
bb1: ; preds = %entry
%2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1]
%2 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1]
%3 = load %struct.quad_struct** %2, align 4 ; <%struct.quad_struct*> [#uses=1]
ret %struct.quad_struct* %3
bb2: ; preds = %entry
%4 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1]
%4 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1]
%5 = load %struct.quad_struct** %4, align 4 ; <%struct.quad_struct*> [#uses=1]
ret %struct.quad_struct* %5
bb3: ; preds = %entry
%6 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
%6 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
%7 = load %struct.quad_struct** %6, align 4 ; <%struct.quad_struct*> [#uses=1]
ret %struct.quad_struct* %7
@@ -100,9 +100,9 @@ bb5: ; preds = %entry
define internal fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* nocapture %tree, i32 %d) nounwind readonly {
entry:
%0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 6 ; <%struct.quad_struct**> [#uses=1]
%0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 6 ; <%struct.quad_struct**> [#uses=1]
%1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=4]
%2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 1 ; <i32*> [#uses=1]
%2 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 1 ; <i32*> [#uses=1]
%3 = load i32* %2, align 4 ; <i32> [#uses=2]
%4 = icmp eq %struct.quad_struct* %1, null ; <i1> [#uses=1]
br i1 %4, label %bb3, label %bb
@@ -122,7 +122,7 @@ bb3: ; preds = %bb1, %bb, %entry
br i1 %8, label %bb7, label %bb4
bb4: ; preds = %bb3
%9 = getelementptr %struct.quad_struct* %q.0, i32 0, i32 0 ; <i32*> [#uses=1]
%9 = getelementptr %struct.quad_struct, %struct.quad_struct* %q.0, i32 0, i32 0 ; <i32*> [#uses=1]
%10 = load i32* %9, align 4 ; <i32> [#uses=1]
%11 = icmp eq i32 %10, 2 ; <i1> [#uses=1]
br i1 %11, label %bb5, label %bb7
@@ -140,27 +140,27 @@ declare fastcc i32 @sum_adjacent(%struct.quad_struct* nocapture, i32, i32, i32)
define i32 @perimeter(%struct.quad_struct* nocapture %tree, i32 %size) nounwind readonly {
entry:
%0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1]
%0 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1]
%1 = load i32* %0, align 4 ; <i32> [#uses=1]
%2 = icmp eq i32 %1, 2 ; <i1> [#uses=1]
br i1 %2, label %bb, label %bb2
bb: ; preds = %entry
%3 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
%3 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
%4 = load %struct.quad_struct** %3, align 4 ; <%struct.quad_struct*> [#uses=1]
%5 = sdiv i32 %size, 2 ; <i32> [#uses=1]
%6 = call i32 @perimeter(%struct.quad_struct* %4, i32 %5) nounwind ; <i32> [#uses=1]
%7 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1]
%7 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1]
%8 = load %struct.quad_struct** %7, align 4 ; <%struct.quad_struct*> [#uses=1]
%9 = sdiv i32 %size, 2 ; <i32> [#uses=1]
%10 = call i32 @perimeter(%struct.quad_struct* %8, i32 %9) nounwind ; <i32> [#uses=1]
%11 = add i32 %10, %6 ; <i32> [#uses=1]
%12 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1]
%12 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1]
%13 = load %struct.quad_struct** %12, align 4 ; <%struct.quad_struct*> [#uses=1]
%14 = sdiv i32 %size, 2 ; <i32> [#uses=1]
%15 = call i32 @perimeter(%struct.quad_struct* %13, i32 %14) nounwind ; <i32> [#uses=1]
%16 = add i32 %15, %11 ; <i32> [#uses=1]
%17 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1]
%17 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1]
%18 = load %struct.quad_struct** %17, align 4 ; <%struct.quad_struct*> [#uses=1]
%19 = sdiv i32 %size, 2 ; <i32> [#uses=1]
%20 = call i32 @perimeter(%struct.quad_struct* %18, i32 %19) nounwind ; <i32> [#uses=1]
@@ -168,7 +168,7 @@ bb: ; preds = %entry
ret i32 %21
bb2: ; preds = %entry
%22 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1]
%22 = getelementptr %struct.quad_struct, %struct.quad_struct* %tree, i32 0, i32 0 ; <i32*> [#uses=1]
%23 = load i32* %22, align 4 ; <i32> [#uses=1]
%24 = icmp eq i32 %23, 0 ; <i1> [#uses=1]
br i1 %24, label %bb3, label %bb23
@@ -179,13 +179,13 @@ bb3: ; preds = %bb2
br i1 %26, label %bb8, label %bb4
bb4: ; preds = %bb3
%27 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1]
%27 = getelementptr %struct.quad_struct, %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1]
%28 = load i32* %27, align 4 ; <i32> [#uses=1]
%29 = icmp eq i32 %28, 1 ; <i1> [#uses=1]
br i1 %29, label %bb8, label %bb6
bb6: ; preds = %bb4
%30 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1]
%30 = getelementptr %struct.quad_struct, %struct.quad_struct* %25, i32 0, i32 0 ; <i32*> [#uses=1]
%31 = load i32* %30, align 4 ; <i32> [#uses=1]
%32 = icmp eq i32 %31, 2 ; <i1> [#uses=1]
br i1 %32, label %bb7, label %bb8
@@ -201,7 +201,7 @@ bb8: ; preds = %bb7, %bb6, %bb4, %bb3
br i1 %35, label %bb10, label %bb9
bb9: ; preds = %bb8
%36 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1]
%36 = getelementptr %struct.quad_struct, %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1]
%37 = load i32* %36, align 4 ; <i32> [#uses=1]
%38 = icmp eq i32 %37, 1 ; <i1> [#uses=1]
br i1 %38, label %bb10, label %bb11
@@ -211,7 +211,7 @@ bb10: ; preds = %bb9, %bb8
br label %bb13
bb11: ; preds = %bb9
%40 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1]
%40 = getelementptr %struct.quad_struct, %struct.quad_struct* %34, i32 0, i32 0 ; <i32*> [#uses=1]
%41 = load i32* %40, align 4 ; <i32> [#uses=1]
%42 = icmp eq i32 %41, 2 ; <i1> [#uses=1]
br i1 %42, label %bb12, label %bb13
@@ -228,7 +228,7 @@ bb13: ; preds = %bb12, %bb11, %bb10
br i1 %46, label %bb15, label %bb14
bb14: ; preds = %bb13
%47 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1]
%47 = getelementptr %struct.quad_struct, %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1]
%48 = load i32* %47, align 4 ; <i32> [#uses=1]
%49 = icmp eq i32 %48, 1 ; <i1> [#uses=1]
br i1 %49, label %bb15, label %bb16
@@ -238,7 +238,7 @@ bb15: ; preds = %bb14, %bb13
br label %bb18
bb16: ; preds = %bb14
%51 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1]
%51 = getelementptr %struct.quad_struct, %struct.quad_struct* %45, i32 0, i32 0 ; <i32*> [#uses=1]
%52 = load i32* %51, align 4 ; <i32> [#uses=1]
%53 = icmp eq i32 %52, 2 ; <i1> [#uses=1]
br i1 %53, label %bb17, label %bb18
@@ -255,7 +255,7 @@ bb18: ; preds = %bb17, %bb16, %bb15
br i1 %57, label %bb20, label %bb19
bb19: ; preds = %bb18
%58 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1]
%58 = getelementptr %struct.quad_struct, %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1]
%59 = load i32* %58, align 4 ; <i32> [#uses=1]
%60 = icmp eq i32 %59, 1 ; <i1> [#uses=1]
br i1 %60, label %bb20, label %bb21
@@ -265,7 +265,7 @@ bb20: ; preds = %bb19, %bb18
ret i32 %61
bb21: ; preds = %bb19
%62 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1]
%62 = getelementptr %struct.quad_struct, %struct.quad_struct* %56, i32 0, i32 0 ; <i32*> [#uses=1]
%63 = load i32* %62, align 4 ; <i32> [#uses=1]
%64 = icmp eq i32 %63, 2 ; <i1> [#uses=1]
br i1 %64, label %bb22, label %bb23

View File

@@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @hello(float* align 128 nocapture %a, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 5
%arrayidx = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx, align 4
ret void
}
@@ -14,7 +14,7 @@ define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
entry:
tail call void @hello(float* %a, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -26,10 +26,10 @@ entry:
; CHECK: %maskcond = icmp eq i64 %maskedptr, 0
; CHECK: call void @llvm.assume(i1 %maskcond)
; CHECK: %0 = load float* %c, align 4
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }
@@ -38,7 +38,7 @@ define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #
entry:
tail call void @hello(float* %a, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -46,10 +46,10 @@ entry:
; CHECK: define void @fooa(float* nocapture align 128 %a, float* nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }
@@ -57,9 +57,9 @@ entry:
define void @hello2(float* align 128 nocapture %a, float* align 128 nocapture %b, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 5
%arrayidx = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx, align 4
%arrayidx1 = getelementptr inbounds float* %b, i64 8
%arrayidx1 = getelementptr inbounds float, float* %b, i64 8
store float %0, float* %arrayidx1, align 4
ret void
}
@@ -68,7 +68,7 @@ define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture rea
entry:
tail call void @hello2(float* %a, float* %b, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -84,12 +84,12 @@ entry:
; CHECK: %maskcond3 = icmp eq i64 %maskedptr2, 0
; CHECK: call void @llvm.assume(i1 %maskcond3)
; CHECK: %0 = load float* %c, align 4
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4
; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8
; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
; CHECK: store float %0, float* %arrayidx1.i, align 4
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }

View File

@@ -17,8 +17,8 @@ define void @outer1() {
define void @inner1(i32 *%ptr) {
%A = load i32* %ptr
store i32 0, i32* %ptr
%C = getelementptr inbounds i32* %ptr, i32 0
%D = getelementptr inbounds i32* %ptr, i32 1
%C = getelementptr inbounds i32, i32* %ptr, i32 0
%D = getelementptr inbounds i32, i32* %ptr, i32 1
%E = bitcast i32* %ptr to i8*
%F = select i1 false, i32* %ptr, i32* @glbl
call void @llvm.lifetime.start(i64 0, i8* %E)
@@ -37,8 +37,8 @@ define void @outer2() {
define void @inner2(i32 *%ptr) {
%A = load i32* %ptr
store i32 0, i32* %ptr
%C = getelementptr inbounds i32* %ptr, i32 0
%D = getelementptr inbounds i32* %ptr, i32 %A
%C = getelementptr inbounds i32, i32* %ptr, i32 0
%D = getelementptr inbounds i32, i32* %ptr, i32 %A
%E = bitcast i32* %ptr to i8*
%F = select i1 false, i32* %ptr, i32* @glbl
call void @llvm.lifetime.start(i64 0, i8* %E)
@@ -95,7 +95,7 @@ define void @outer4(i32 %A) {
; %B poisons this call, scalar-repl can't handle that instruction. However, we
; still want to detect that the icmp and branch *can* be handled.
define void @inner4(i32 *%ptr, i32 %A) {
%B = getelementptr inbounds i32* %ptr, i32 %A
%B = getelementptr inbounds i32, i32* %ptr, i32 %A
%C = icmp eq i32* %ptr, null
br i1 %C, label %bb.true, label %bb.false
bb.true:
@@ -139,11 +139,11 @@ define void @outer5() {
define void @inner5(i1 %flag, i32 *%ptr) {
%A = load i32* %ptr
store i32 0, i32* %ptr
%C = getelementptr inbounds i32* %ptr, i32 0
%C = getelementptr inbounds i32, i32* %ptr, i32 0
br i1 %flag, label %if.then, label %exit
if.then:
%D = getelementptr inbounds i32* %ptr, i32 %A
%D = getelementptr inbounds i32, i32* %ptr, i32 %A
%E = bitcast i32* %ptr to i8*
%F = select i1 false, i32* %ptr, i32* @glbl
call void @llvm.lifetime.start(i64 0, i8* %E)

View File

@@ -45,7 +45,7 @@ entry:
tail call void @llvm.dbg.declare(metadata [20 x i8]* %agg.tmp.sroa.3, metadata !46, metadata !48), !dbg !49
%agg.tmp.sroa.0.0.copyload = load i32* getelementptr inbounds (%struct.A* @b, i64 0, i32 0), align 8, !dbg !50
tail call void @llvm.dbg.value(metadata i32 %agg.tmp.sroa.0.0.copyload, i64 0, metadata !46, metadata !51), !dbg !49
%agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !50
%agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds [20 x i8], [20 x i8]* %agg.tmp.sroa.3, i64 0, i64 0, !dbg !50
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.3.0..sroa_idx, i8* getelementptr (i8* bitcast (%struct.A* @b to i8*), i64 4), i64 20, i32 4, i1 false), !dbg !50
tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !46, metadata !31) #2, !dbg !49
%tobool.i = icmp eq i32 %agg.tmp.sroa.0.0.copyload, 0, !dbg !52

View File

@@ -12,7 +12,7 @@ entry:
define internal fastcc void @a() nounwind ssp {
entry:
%al = alloca [3 x i32], align 4
%0 = getelementptr inbounds [3 x i32]* %al, i32 0, i32 2
%0 = getelementptr inbounds [3 x i32], [3 x i32]* %al, i32 0, i32 2
call fastcc void @c() nounwind
unreachable

View File

@@ -7,13 +7,13 @@ target triple = "powerpc64-unknown-linux-gnu"
define void @foo(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32], align 4
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 4
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void
@@ -22,13 +22,13 @@ entry:
define void @foo0(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32]
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 4
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void
@@ -39,13 +39,13 @@ declare void @bar(i32*) #1
define void @goo(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32], align 32
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 32
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void

View File

@@ -8,13 +8,13 @@ target triple = "powerpc64-unknown-linux-gnu"
define void @foo(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32], align 4
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 4
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void
@@ -23,13 +23,13 @@ entry:
define void @foo0(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32]
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 4
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void
@@ -38,13 +38,13 @@ entry:
define void @foo1(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32], align 1
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 4
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void
@@ -55,13 +55,13 @@ declare void @bar(i32*) #1
define void @goo(%struct.s* byval nocapture readonly %a) {
entry:
%x = alloca [2 x i32], align 32
%a1 = getelementptr inbounds %struct.s* %a, i64 0, i32 0
%a1 = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 0
%0 = load i32* %a1, align 4
%arrayidx = getelementptr inbounds [2 x i32]* %x, i64 0, i64 0
%arrayidx = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 0
store i32 %0, i32* %arrayidx, align 32
%b = getelementptr inbounds %struct.s* %a, i64 0, i32 1
%b = getelementptr inbounds %struct.s, %struct.s* %a, i64 0, i32 1
%1 = load i32* %b, align 4
%arrayidx2 = getelementptr inbounds [2 x i32]* %x, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], [2 x i32]* %x, i64 0, i64 1
store i32 %1, i32* %arrayidx2, align 4
call void @bar(i32* %arrayidx) #2
ret void

View File

@@ -25,7 +25,7 @@ define internal %T* @test2f(i1 %cond, %T* %P) {
br i1 %cond, label %T, label %F
T:
%A = getelementptr %T* %P, i32 0, i32 0
%A = getelementptr %T, %T* %P, i32 0, i32 0
store i32 42, i32* %A
ret %T* %P
@@ -37,7 +37,7 @@ define i32 @test2(i1 %cond) {
%A = alloca %T
%B = call %T* @test2f(i1 %cond, %T* %A)
%C = getelementptr %T* %B, i32 0, i32 0
%C = getelementptr %T, %T* %B, i32 0, i32 0
%D = load i32* %C
ret i32 %D

View File

@@ -7,7 +7,7 @@
define internal void @f(%struct.ss* byval %b) nounwind {
entry:
%tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
%tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
%tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
%tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
store i32 %tmp2, i32* %tmp, align 4
@@ -19,9 +19,9 @@ declare i32 @printf(i8*, ...) nounwind
define i32 @test1() nounwind {
entry:
%S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
%tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 1, i32* %tmp1, align 8
%tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
%tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
store i64 2, i64* %tmp4, align 4
call void @f( %struct.ss* byval %S ) nounwind
ret i32 0
@@ -37,7 +37,7 @@ entry:
define internal i32 @f2(%struct.ss* byval %b) nounwind readonly {
entry:
%tmp = getelementptr %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
%tmp = getelementptr %struct.ss, %struct.ss* %b, i32 0, i32 0 ; <i32*> [#uses=2]
%tmp1 = load i32* %tmp, align 4 ; <i32> [#uses=1]
%tmp2 = add i32 %tmp1, 1 ; <i32> [#uses=1]
ret i32 %tmp2
@@ -46,9 +46,9 @@ entry:
define i32 @test2() nounwind {
entry:
%S = alloca %struct.ss ; <%struct.ss*> [#uses=4]
%tmp1 = getelementptr %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp1 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 1, i32* %tmp1, align 8
%tmp4 = getelementptr %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
%tmp4 = getelementptr %struct.ss, %struct.ss* %S, i32 0, i32 1 ; <i64*> [#uses=1]
store i64 2, i64* %tmp4, align 4
%X = call i32 @f2( %struct.ss* byval %S ) nounwind
ret i32 %X
@@ -112,7 +112,7 @@ entry:
define internal void @f5(%struct.S0* byval nocapture readonly align 4 %p) {
entry:
store i32 0, i32* getelementptr inbounds (%struct.S0* @b, i64 0, i32 0), align 4
%f2 = getelementptr inbounds %struct.S0* %p, i64 0, i32 0
%f2 = getelementptr inbounds %struct.S0, %struct.S0* %p, i64 0, i32 0
%0 = load i32* %f2, align 4
store i32 %0, i32* @a, align 4
ret void

View File

@@ -10,8 +10,8 @@
define i32 @foo(%struct.foo* byval align 8 %f, i32 %a) {
entry:
%a1 = getelementptr inbounds %struct.foo* %f, i32 0, i32 1
%arrayidx = getelementptr inbounds [16 x i32]* %a1, i32 0, i32 %a
%a1 = getelementptr inbounds %struct.foo, %struct.foo* %f, i32 0, i32 1
%arrayidx = getelementptr inbounds [16 x i32], [16 x i32]* %a1, i32 0, i32 %a
%tmp2 = load i32* %arrayidx, align 1
ret i32 %tmp2
}

View File

@@ -14,12 +14,12 @@ target triple = "x86_64-apple-darwin10.0.0"
define i32 @main() nounwind ssp {
entry:
%cont = alloca %struct.cont_t, align 8 ; <%struct.cont_t*> [#uses=4]
%tmp = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp1 = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=2]
%tmp = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp1 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=2]
store void (i8*, i32)* bitcast (void (%struct.cont_t*, i32)* @quit to void (i8*, i32)*), void (i8*, i32)** %tmp1
%tmp2 = load void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1]
store void (i8*, i32)* %tmp2, void (i8*, i32)** %tmp
%tmp3 = getelementptr inbounds %struct.cont_t* %cont, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp3 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %cont, i32 0, i32 1 ; <i8**> [#uses=1]
store i8* null, i8** %tmp3
call void @foo(%struct.cont_t* %cont)
ret i32 0
@@ -35,13 +35,13 @@ define internal void @foo(%struct.cont_t* %c) nounwind ssp {
entry:
%sf = alloca %struct.foo_sf_t, align 8 ; <%struct.foo_sf_t*> [#uses=3]
%next = alloca %struct.cont_t, align 8 ; <%struct.cont_t*> [#uses=3]
%tmp = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
%tmp = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
store %struct.cont_t* %c, %struct.cont_t** %tmp
%tmp2 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1]
%tmp2 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1]
store i32 2, i32* %tmp2
%tmp4 = getelementptr inbounds %struct.cont_t* %next, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp4 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %next, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
store void (i8*, i32)* bitcast (void (%struct.foo_sf_t*, i32)* @foo2 to void (i8*, i32)*), void (i8*, i32)** %tmp4
%tmp5 = getelementptr inbounds %struct.cont_t* %next, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp5 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %next, i32 0, i32 1 ; <i8**> [#uses=1]
%conv = bitcast %struct.foo_sf_t* %sf to i8* ; <i8*> [#uses=1]
store i8* %conv, i8** %tmp5
call void @bar(%struct.cont_t* %next, i32 14)
@@ -50,14 +50,14 @@ entry:
define internal void @foo2(%struct.foo_sf_t* %sf, i32 %y) nounwind ssp {
entry:
%tmp1 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
%tmp1 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
%tmp2 = load %struct.cont_t** %tmp1 ; <%struct.cont_t*> [#uses=1]
%tmp3 = getelementptr inbounds %struct.cont_t* %tmp2, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp3 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %tmp2, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp4 = load void (i8*, i32)** %tmp3 ; <void (i8*, i32)*> [#uses=1]
%tmp6 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
%tmp6 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 0 ; <%struct.cont_t**> [#uses=1]
%tmp7 = load %struct.cont_t** %tmp6 ; <%struct.cont_t*> [#uses=1]
%conv = bitcast %struct.cont_t* %tmp7 to i8* ; <i8*> [#uses=1]
%tmp9 = getelementptr inbounds %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1]
%tmp9 = getelementptr inbounds %struct.foo_sf_t, %struct.foo_sf_t* %sf, i32 0, i32 1 ; <i32*> [#uses=1]
%tmp10 = load i32* %tmp9 ; <i32> [#uses=1]
%mul = mul i32 %tmp10, %y ; <i32> [#uses=1]
call void %tmp4(i8* %conv, i32 %mul)
@@ -66,9 +66,9 @@ entry:
define internal void @bar(%struct.cont_t* %c, i32 %y) nounwind ssp {
entry:
%tmp1 = getelementptr inbounds %struct.cont_t* %c, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp1 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %c, i32 0, i32 0 ; <void (i8*, i32)**> [#uses=1]
%tmp2 = load void (i8*, i32)** %tmp1 ; <void (i8*, i32)*> [#uses=1]
%tmp4 = getelementptr inbounds %struct.cont_t* %c, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp4 = getelementptr inbounds %struct.cont_t, %struct.cont_t* %c, i32 0, i32 1 ; <i8**> [#uses=1]
%tmp5 = load i8** %tmp4 ; <i8*> [#uses=1]
%add = add nsw i32 %y, 5 ; <i32> [#uses=1]
call void %tmp2(i8* %tmp5, i32 %add)

View File

@@ -78,7 +78,7 @@ entry:
cast.notnull: ; preds = %entry
%1 = bitcast %struct.C* %d to i8* ; <i8*> [#uses=1]
%add.ptr = getelementptr i8* %1, i64 8 ; <i8*> [#uses=1]
%add.ptr = getelementptr i8, i8* %1, i64 8 ; <i8*> [#uses=1]
%2 = bitcast i8* %add.ptr to %struct.A* ; <%struct.A*> [#uses=1]
br label %cast.end
@@ -86,7 +86,7 @@ cast.end: ; preds = %entry, %cast.notnul
%3 = phi %struct.A* [ %2, %cast.notnull ], [ null, %entry ] ; <%struct.A*> [#uses=2]
%4 = bitcast %struct.A* %3 to i32 (%struct.A*)*** ; <i32 (%struct.A*)***> [#uses=1]
%5 = load i32 (%struct.A*)*** %4 ; <i32 (%struct.A*)**> [#uses=1]
%vfn = getelementptr inbounds i32 (%struct.A*)** %5, i64 0 ; <i32 (%struct.A*)**> [#uses=1]
%vfn = getelementptr inbounds i32 (%struct.A*)*, i32 (%struct.A*)** %5, i64 0 ; <i32 (%struct.A*)**> [#uses=1]
%6 = load i32 (%struct.A*)** %vfn ; <i32 (%struct.A*)*> [#uses=1]
%call = call i32 %6(%struct.A* %3) ; <i32> [#uses=1]
ret i32 %call
@@ -100,7 +100,7 @@ entry:
define linkonce_odr i32 @_ZThn8_N1D1fEv(%struct.C* %this) {
entry:
%0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8* %0, i64 -8 ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8, i8* %0, i64 -8 ; <i8*> [#uses=1]
%2 = bitcast i8* %1 to %struct.C* ; <%struct.C*> [#uses=1]
%call = call i32 @_ZN1D1fEv(%struct.C* %2) ; <i32> [#uses=1]
ret i32 %call
@@ -110,11 +110,11 @@ define linkonce_odr void @_ZN1DC2Ev(%struct.C* %this) inlinehint ssp align 2 {
entry:
call void @_ZN1CC2Ev(%struct.C* %this)
%0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1]
%2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1D, i64 0, i64 2), i8*** %2
%3 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%4 = getelementptr inbounds i8* %3, i64 8 ; <i8*> [#uses=1]
%4 = getelementptr inbounds i8, i8* %3, i64 8 ; <i8*> [#uses=1]
%5 = bitcast i8* %4 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1D, i64 0, i64 5), i8*** %5
ret void
@@ -125,15 +125,15 @@ entry:
%0 = bitcast %struct.C* %this to %struct.A* ; <%struct.A*> [#uses=1]
call void @_ZN1AC2Ev(%struct.A* %0)
%1 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%2 = getelementptr inbounds i8* %1, i64 8 ; <i8*> [#uses=1]
%2 = getelementptr inbounds i8, i8* %1, i64 8 ; <i8*> [#uses=1]
%3 = bitcast i8* %2 to %struct.A* ; <%struct.A*> [#uses=1]
call void @_ZN1BC2Ev(%struct.A* %3)
%4 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%5 = getelementptr inbounds i8* %4, i64 0 ; <i8*> [#uses=1]
%5 = getelementptr inbounds i8, i8* %4, i64 0 ; <i8*> [#uses=1]
%6 = bitcast i8* %5 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1C, i64 0, i64 2), i8*** %6
%7 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%8 = getelementptr inbounds i8* %7, i64 8 ; <i8*> [#uses=1]
%8 = getelementptr inbounds i8, i8* %7, i64 8 ; <i8*> [#uses=1]
%9 = bitcast i8* %8 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([6 x i8*]* @_ZTV1C, i64 0, i64 5), i8*** %9
ret void
@@ -147,7 +147,7 @@ entry:
define linkonce_odr i32 @_ZThn8_N1C1fEv(%struct.C* %this) {
entry:
%0 = bitcast %struct.C* %this to i8* ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8* %0, i64 -8 ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8, i8* %0, i64 -8 ; <i8*> [#uses=1]
%2 = bitcast i8* %1 to %struct.C* ; <%struct.C*> [#uses=1]
%call = call i32 @_ZN1C1fEv(%struct.C* %2) ; <i32> [#uses=1]
ret i32 %call
@@ -156,7 +156,7 @@ entry:
define linkonce_odr void @_ZN1AC2Ev(%struct.A* %this) inlinehint ssp align 2 {
entry:
%0 = bitcast %struct.A* %this to i8* ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1]
%2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2), i8*** %2
ret void
@@ -165,7 +165,7 @@ entry:
define linkonce_odr void @_ZN1BC2Ev(%struct.A* %this) inlinehint ssp align 2 {
entry:
%0 = bitcast %struct.A* %this to i8* ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8* %0, i64 0 ; <i8*> [#uses=1]
%1 = getelementptr inbounds i8, i8* %0, i64 0 ; <i8*> [#uses=1]
%2 = bitcast i8* %1 to i8*** ; <i8***> [#uses=1]
store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2), i8*** %2
ret void

View File

@@ -29,36 +29,36 @@ define i32 @caller(%struct.sphere* %i) {
declare void @fix(%struct.ray*)
define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture byval align 8 %ray, %struct.spoint* %sp) nounwind uwtable ssp {
%1 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 0
%1 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 0
%2 = load double* %1, align 8
%3 = fmul double %2, %2
%4 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 1
%4 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 1
%5 = load double* %4, align 8
%6 = fmul double %5, %5
%7 = fadd double %3, %6
%8 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 2
%8 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 1, i32 2
%9 = load double* %8, align 8
%10 = fmul double %9, %9
%11 = fadd double %7, %10
%12 = fmul double %2, 2.000000e+00
%13 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 0
%13 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 0
%14 = load double* %13, align 8
%15 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 0
%15 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 0
%16 = load double* %15, align 8
%17 = fsub double %14, %16
%18 = fmul double %12, %17
%19 = fmul double %5, 2.000000e+00
%20 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 1
%20 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 1
%21 = load double* %20, align 8
%22 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 1
%22 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 1
%23 = load double* %22, align 8
%24 = fsub double %21, %23
%25 = fmul double %19, %24
%26 = fadd double %18, %25
%27 = fmul double %9, 2.000000e+00
%28 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 2
%28 = getelementptr inbounds %struct.ray, %struct.ray* %ray, i64 0, i32 0, i32 2
%29 = load double* %28, align 8
%30 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 2
%30 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 0, i32 2
%31 = load double* %30, align 8
%32 = fsub double %29, %31
%33 = fmul double %27, %32
@@ -82,7 +82,7 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by
%51 = fsub double %49, %50
%52 = fmul double %51, 2.000000e+00
%53 = fadd double %52, %45
%54 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 1
%54 = getelementptr inbounds %struct.sphere, %struct.sphere* %sph, i64 0, i32 1
%55 = load double* %54, align 8
%56 = fmul double %55, %55
%57 = fsub double %53, %56
@@ -121,37 +121,37 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by
%t2.0 = select i1 %72, double %t1.0, double %70
%79 = fcmp olt double %t1.0, %t2.0
%80 = select i1 %79, double %t1.0, double %t2.0
%81 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 3
%81 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 3
store double %80, double* %81, align 8
%82 = fmul double %80, %2
%83 = fadd double %14, %82
%84 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 0
%84 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 0
store double %83, double* %84, align 8
%85 = fmul double %5, %80
%86 = fadd double %21, %85
%87 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 1
%87 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 1
store double %86, double* %87, align 8
%88 = fmul double %9, %80
%89 = fadd double %29, %88
%90 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 2
%90 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 0, i32 2
store double %89, double* %90, align 8
%91 = load double* %15, align 8
%92 = fsub double %83, %91
%93 = load double* %54, align 8
%94 = fdiv double %92, %93
%95 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 0
%95 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 0
store double %94, double* %95, align 8
%96 = load double* %22, align 8
%97 = fsub double %86, %96
%98 = load double* %54, align 8
%99 = fdiv double %97, %98
%100 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 1
%100 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 1
store double %99, double* %100, align 8
%101 = load double* %30, align 8
%102 = fsub double %89, %101
%103 = load double* %54, align 8
%104 = fdiv double %102, %103
%105 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 2
%105 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 1, i32 2
store double %104, double* %105, align 8
%106 = fmul double %2, %94
%107 = fmul double %5, %99
@@ -168,9 +168,9 @@ define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture by
%118 = fmul double %104, %111
%119 = fsub double %118, %9
%120 = fsub double -0.000000e+00, %119
%.06 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 0
%.18 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 1
%.210 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 2
%.06 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 0
%.18 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 1
%.210 = getelementptr inbounds %struct.spoint, %struct.spoint* %sp, i64 0, i32 2, i32 2
%121 = fmul double %113, %113
%122 = fmul double %116, %116
%123 = fadd double %121, %122

View File

@@ -15,7 +15,7 @@ entry:
if.then: ; preds = %entry
%a1 = load float* %a, align 8
%arrayidx1 = getelementptr inbounds float* %a, i64 1
%arrayidx1 = getelementptr inbounds float, float* %a, i64 1
%a2 = load float* %arrayidx1, align 4
%add = fadd fast float %a1, %a2
br label %if.end

View File

@@ -6,7 +6,7 @@
declare void @ext_method(i8*, i32)
define linkonce_odr void @thunk(i8* %this, ...) {
%this_adj = getelementptr i8* %this, i32 4
%this_adj = getelementptr i8, i8* %this, i32 4
musttail call void (i8*, ...)* bitcast (void (i8*, i32)* @ext_method to void (i8*, ...)*)(i8* %this_adj, ...)
ret void
}

View File

@@ -10,7 +10,7 @@
define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 {
entry:
%data = alloca [2 x i8], align 1
%arraydecay = getelementptr inbounds [2 x i8]* %data, i64 0, i64 0
%arraydecay = getelementptr inbounds [2 x i8], [2 x i8]* %data, i64 0, i64 0
call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([2 x i8]* @.str, i64 0, i64 0), i64 1)
call fastcc void @memcpy2(i8* %arraydecay, i8* getelementptr inbounds ([3 x i8]* @.str1, i64 0, i64 0), i64 2)
ret i32 0

View File

@@ -47,7 +47,7 @@ entry:
store float* %dst, float** %dst.addr, align 4
call void @llvm.dbg.declare(metadata float** %dst.addr, metadata !20, metadata !17), !dbg !21
%0 = load float** %dst.addr, align 4, !dbg !22
%arrayidx = getelementptr inbounds float* %0, i32 0, !dbg !22
%arrayidx = getelementptr inbounds float, float* %0, i32 0, !dbg !22
%1 = load float* %arrayidx, align 4, !dbg !22
%call = call float @foo(float %1), !dbg !22
@@ -55,7 +55,7 @@ entry:
; CHECK: void @llvm.dbg.declare(metadata float* [[x_addr_i]], metadata [[m23:![0-9]+]], metadata !17), !dbg [[m24:![0-9]+]]
%2 = load float** %dst.addr, align 4, !dbg !22
%arrayidx1 = getelementptr inbounds float* %2, i32 0, !dbg !22
%arrayidx1 = getelementptr inbounds float, float* %2, i32 0, !dbg !22
store float %call, float* %arrayidx1, align 4, !dbg !22
ret void, !dbg !23
}

View File

@@ -11,13 +11,13 @@ entry:
%tmp = load i32* %a.addr, align 4
%idxprom = sext i32 %tmp to i64
%tmp1 = load i32** @data, align 8
%arrayidx = getelementptr inbounds i32* %tmp1, i64 %idxprom
%arrayidx = getelementptr inbounds i32, i32* %tmp1, i64 %idxprom
%tmp2 = load i32* %arrayidx, align 4
%tmp3 = load i32* %a.addr, align 4
%add = add nsw i32 %tmp3, 1
%idxprom1 = sext i32 %add to i64
%tmp4 = load i32** @data, align 8
%arrayidx2 = getelementptr inbounds i32* %tmp4, i64 %idxprom1
%arrayidx2 = getelementptr inbounds i32, i32* %tmp4, i64 %idxprom1
%tmp5 = load i32* %arrayidx2, align 4
%mul = mul nsw i32 %tmp2, %tmp5
store i32 %mul, i32* %res, align 4
@@ -35,7 +35,7 @@ for.body: ; preds = %for.cond
%tmp8 = load i32* %i, align 4
%idxprom3 = sext i32 %tmp8 to i64
%tmp9 = load i32** @data, align 8
%arrayidx4 = getelementptr inbounds i32* %tmp9, i64 %idxprom3
%arrayidx4 = getelementptr inbounds i32, i32* %tmp9, i64 %idxprom3
call void @fct0(i32* %arrayidx4)
br label %for.inc
@@ -59,7 +59,7 @@ for.body7: ; preds = %for.cond5
%tmp13 = load i32* %i, align 4
%idxprom8 = sext i32 %tmp13 to i64
%tmp14 = load i32** @data, align 8
%arrayidx9 = getelementptr inbounds i32* %tmp14, i64 %idxprom8
%arrayidx9 = getelementptr inbounds i32, i32* %tmp14, i64 %idxprom8
call void @fct0(i32* %arrayidx9)
br label %for.inc10
@@ -83,7 +83,7 @@ for.body15: ; preds = %for.cond13
%tmp18 = load i32* %i, align 4
%idxprom16 = sext i32 %tmp18 to i64
%tmp19 = load i32** @data, align 8
%arrayidx17 = getelementptr inbounds i32* %tmp19, i64 %idxprom16
%arrayidx17 = getelementptr inbounds i32, i32* %tmp19, i64 %idxprom16
call void @fct0(i32* %arrayidx17)
br label %for.inc18
@@ -110,14 +110,14 @@ entry:
%shl = shl i32 %tmp, 1
%idxprom = sext i32 %shl to i64
%tmp1 = load i32** @data, align 8
%arrayidx = getelementptr inbounds i32* %tmp1, i64 %idxprom
%arrayidx = getelementptr inbounds i32, i32* %tmp1, i64 %idxprom
%tmp2 = load i32* %arrayidx, align 4
%tmp3 = load i32* %a.addr, align 4
%shl1 = shl i32 %tmp3, 1
%add = add nsw i32 %shl1, 13
%idxprom2 = sext i32 %add to i64
%tmp4 = load i32** @data, align 8
%arrayidx3 = getelementptr inbounds i32* %tmp4, i64 %idxprom2
%arrayidx3 = getelementptr inbounds i32, i32* %tmp4, i64 %idxprom2
%tmp5 = load i32* %arrayidx3, align 4
%mul = mul nsw i32 %tmp2, %tmp5
store i32 %mul, i32* %res, align 4
@@ -135,7 +135,7 @@ for.body: ; preds = %for.cond
%tmp8 = load i32* %i, align 4
%idxprom4 = sext i32 %tmp8 to i64
%tmp9 = load i32** @data, align 8
%arrayidx5 = getelementptr inbounds i32* %tmp9, i64 %idxprom4
%arrayidx5 = getelementptr inbounds i32, i32* %tmp9, i64 %idxprom4
call void @fct0(i32* %arrayidx5)
br label %for.inc
@@ -159,7 +159,7 @@ for.body8: ; preds = %for.cond6
%tmp13 = load i32* %i, align 4
%idxprom9 = sext i32 %tmp13 to i64
%tmp14 = load i32** @data, align 8
%arrayidx10 = getelementptr inbounds i32* %tmp14, i64 %idxprom9
%arrayidx10 = getelementptr inbounds i32, i32* %tmp14, i64 %idxprom9
call void @fct0(i32* %arrayidx10)
br label %for.inc11
@@ -183,7 +183,7 @@ for.body16: ; preds = %for.cond14
%tmp18 = load i32* %i, align 4
%idxprom17 = sext i32 %tmp18 to i64
%tmp19 = load i32** @data, align 8
%arrayidx18 = getelementptr inbounds i32* %tmp19, i64 %idxprom17
%arrayidx18 = getelementptr inbounds i32, i32* %tmp19, i64 %idxprom17
call void @fct0(i32* %arrayidx18)
br label %for.inc19

View File

@@ -6,12 +6,12 @@ target triple = "x86_64-unknown-linux-gnu"
define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4, !noalias !3
%arrayidx.i = getelementptr inbounds float* %a, i64 5
%arrayidx.i = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8
%arrayidx1.i = getelementptr inbounds float* %b, i64 8
%arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7
%1 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %1, float* %arrayidx, align 4
ret void
}
@@ -26,20 +26,20 @@ entry:
; CHECK: define void @foo(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4, !noalias !6
; CHECK: %arrayidx.i.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !12, !noalias !13
; CHECK: %arrayidx1.i.i = getelementptr inbounds float* %b, i64 8
; CHECK: %arrayidx1.i.i = getelementptr inbounds float, float* %b, i64 8
; CHECK: store float %0, float* %arrayidx1.i.i, align 4, !alias.scope !14, !noalias !15
; CHECK: %1 = load float* %c, align 4, !noalias !16
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx.i, align 4, !noalias !16
; CHECK: %2 = load float* %a, align 4, !alias.scope !16, !noalias !17
; CHECK: %arrayidx.i.i1 = getelementptr inbounds float* %b, i64 5
; CHECK: %arrayidx.i.i1 = getelementptr inbounds float, float* %b, i64 5
; CHECK: store float %2, float* %arrayidx.i.i1, align 4, !alias.scope !21, !noalias !22
; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float* %b, i64 8
; CHECK: %arrayidx1.i.i2 = getelementptr inbounds float, float* %b, i64 8
; CHECK: store float %2, float* %arrayidx1.i.i2, align 4, !alias.scope !23, !noalias !24
; CHECK: %3 = load float* %a, align 4, !alias.scope !16
; CHECK: %arrayidx.i3 = getelementptr inbounds float* %b, i64 7
; CHECK: %arrayidx.i3 = getelementptr inbounds float, float* %b, i64 7
; CHECK: store float %3, float* %arrayidx.i3, align 4, !alias.scope !16
; CHECK: ret void
; CHECK: }

View File

@@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @hello(float* noalias nocapture %a, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 5
%arrayidx = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx, align 4
ret void
}
@@ -14,7 +14,7 @@ define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
entry:
tail call void @hello(float* %a, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -22,10 +22,10 @@ entry:
; CHECK: define void @foo(float* nocapture %a, float* nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4, !noalias !0
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !0
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }
@@ -33,9 +33,9 @@ entry:
define void @hello2(float* noalias nocapture %a, float* noalias nocapture %b, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 5
%arrayidx = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx, align 4
%arrayidx1 = getelementptr inbounds float* %b, i64 8
%arrayidx1 = getelementptr inbounds float, float* %b, i64 8
store float %0, float* %arrayidx1, align 4
ret void
}
@@ -44,7 +44,7 @@ define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture rea
entry:
tail call void @hello2(float* %a, float* %b, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -52,12 +52,12 @@ entry:
; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4, !noalias !3
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !7, !noalias !8
; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8
; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
; CHECK: store float %0, float* %arrayidx1.i, align 4, !alias.scope !8, !noalias !7
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }

View File

@@ -5,7 +5,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @hello(float* noalias nocapture %a, float* noalias nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 5
%arrayidx = getelementptr inbounds float, float* %a, i64 5
store float %0, float* %arrayidx, align 4
ret void
}
@@ -14,7 +14,7 @@ define void @foo(float* noalias nocapture %a, float* noalias nocapture readonly
entry:
tail call void @hello(float* %a, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -22,10 +22,10 @@ entry:
; CHECK: define void @foo(float* noalias nocapture %a, float* noalias nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4, !alias.scope !0, !noalias !3
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i, align 4, !alias.scope !3, !noalias !0
; CHECK: %1 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }
@@ -33,9 +33,9 @@ entry:
define void @hello2(float* noalias nocapture %a, float* noalias nocapture %b, float* nocapture readonly %c) #0 {
entry:
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 6
%arrayidx = getelementptr inbounds float, float* %a, i64 6
store float %0, float* %arrayidx, align 4
%arrayidx1 = getelementptr inbounds float* %b, i64 8
%arrayidx1 = getelementptr inbounds float, float* %b, i64 8
store float %0, float* %arrayidx1, align 4
ret void
}
@@ -47,7 +47,7 @@ entry:
tail call void @foo(float* %a, float* %c)
tail call void @hello2(float* %a, float* %b, float* %c)
%0 = load float* %c, align 4
%arrayidx = getelementptr inbounds float* %a, i64 7
%arrayidx = getelementptr inbounds float, float* %a, i64 7
store float %0, float* %arrayidx, align 4
ret void
}
@@ -55,18 +55,18 @@ entry:
; CHECK: define void @foo2(float* nocapture %a, float* nocapture %b, float* nocapture readonly %c) #0 {
; CHECK: entry:
; CHECK: %0 = load float* %c, align 4, !alias.scope !5, !noalias !10
; CHECK: %arrayidx.i.i = getelementptr inbounds float* %a, i64 5
; CHECK: %arrayidx.i.i = getelementptr inbounds float, float* %a, i64 5
; CHECK: store float %0, float* %arrayidx.i.i, align 4, !alias.scope !10, !noalias !5
; CHECK: %1 = load float* %c, align 4, !alias.scope !13, !noalias !14
; CHECK: %arrayidx.i = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx.i = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %1, float* %arrayidx.i, align 4, !alias.scope !14, !noalias !13
; CHECK: %2 = load float* %c, align 4, !noalias !15
; CHECK: %arrayidx.i1 = getelementptr inbounds float* %a, i64 6
; CHECK: %arrayidx.i1 = getelementptr inbounds float, float* %a, i64 6
; CHECK: store float %2, float* %arrayidx.i1, align 4, !alias.scope !19, !noalias !20
; CHECK: %arrayidx1.i = getelementptr inbounds float* %b, i64 8
; CHECK: %arrayidx1.i = getelementptr inbounds float, float* %b, i64 8
; CHECK: store float %2, float* %arrayidx1.i, align 4, !alias.scope !20, !noalias !19
; CHECK: %3 = load float* %c, align 4
; CHECK: %arrayidx = getelementptr inbounds float* %a, i64 7
; CHECK: %arrayidx = getelementptr inbounds float, float* %a, i64 7
; CHECK: store float %3, float* %arrayidx, align 4
; CHECK: ret void
; CHECK: }

View File

@@ -8,8 +8,8 @@ define i32 @outer1() {
; CHECK: ret i32
%ptr = alloca i32
%ptr1 = getelementptr inbounds i32* %ptr, i32 0
%ptr2 = getelementptr inbounds i32* %ptr, i32 42
%ptr1 = getelementptr inbounds i32, i32* %ptr, i32 0
%ptr2 = getelementptr inbounds i32, i32* %ptr, i32 42
%result = call i32 @inner1(i32* %ptr1, i32* %ptr2)
ret i32 %result
}
@@ -36,8 +36,8 @@ define i32 @outer2(i32* %ptr) {
; CHECK: call i32 @inner2
; CHECK: ret i32
%ptr1 = getelementptr i32* %ptr, i32 0
%ptr2 = getelementptr i32* %ptr, i32 42
%ptr1 = getelementptr i32, i32* %ptr, i32 0
%ptr2 = getelementptr i32, i32* %ptr, i32 42
%result = call i32 @inner2(i32* %ptr1, i32* %ptr2)
ret i32 %result
}