diff options
Diffstat (limited to 'test/NaCl/Bitcode/bitcast-elide.ll')
-rw-r--r-- | test/NaCl/Bitcode/bitcast-elide.ll | 114 |
1 files changed, 2 insertions, 112 deletions
diff --git a/test/NaCl/Bitcode/bitcast-elide.ll b/test/NaCl/Bitcode/bitcast-elide.ll index bc1edb7bf5..8b63606392 100644 --- a/test/NaCl/Bitcode/bitcast-elide.ll +++ b/test/NaCl/Bitcode/bitcast-elide.ll @@ -1,17 +1,10 @@ ; Test how we handle eliding (pointer) bitcast instructions. -; RUN: llvm-as < %s | pnacl-freeze --pnacl-version=1 \ -; RUN: | pnacl-bcanalyzer -dump-records \ -; RUN: | FileCheck %s -check-prefix=PF1 - -; RUN: llvm-as < %s | pnacl-freeze --pnacl-version=1 | pnacl-thaw \ -; RUN: | llvm-dis - | FileCheck %s -check-prefix=TD1 - -; RUN: llvm-as < %s | pnacl-freeze --pnacl-version=2 \ +; RUN: llvm-as < %s | pnacl-freeze \ ; RUN: | pnacl-bcanalyzer -dump-records \ ; RUN: | FileCheck %s -check-prefix=PF2 -; RUN: llvm-as < %s | pnacl-freeze --pnacl-version=2 | pnacl-thaw \ +; RUN: llvm-as < %s | pnacl-freeze | pnacl-thaw \ ; RUN: | llvm-dis - | FileCheck %s -check-prefix=TD2 ; ------------------------------------------------------ @@ -27,19 +20,6 @@ define void @SimpleLoad() { ret void } -; TD1: define void @SimpleLoad() { -; TD1-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: %2 = load i32* %1, align 4 -; TD1-NEXT: ret void -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1-NEXT: <DECLAREBLOCKS op0=1/> -; PF1-NEXT: <INST_CAST op0=1 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_RET/> -; PF1-NEXT: </FUNCTION_BLOCK> - ; TD2: define void @SimpleLoad() { ; TD2-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* ; TD2-NEXT: %2 = load i32* %1, align 4 @@ -62,21 +42,6 @@ define void @SimpleLoadAlloca() { ret void } -; TD1: define void @SimpleLoadAlloca() { -; TD1-NEXT: %1 = alloca i8, i32 4, align 4 -; TD1-NEXT: %2 = bitcast i8* %1 to i32* -; TD1-NEXT: %3 = load i32* %2, align 4 -; TD1-NEXT: ret void -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1: </CONSTANTS_BLOCK> -; PF1-NEXT: <INST_ALLOCA op0=1 op1=3/> -; PF1-NEXT: <INST_CAST op0=1 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_RET/> -; PF1-NEXT: </FUNCTION_BLOCK> - ; TD2: define void @SimpleLoadAlloca() { ; TD2-NEXT: %1 = alloca i8, i32 4, align 4 ; TD2-NEXT: %2 = bitcast i8* %1 to i32* @@ -103,25 +68,6 @@ define i32 @TwoLoads(i32 %i) { ret i32 %5 } -; TD1: define i32 @TwoLoads(i32 %i) { -; TD1-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: %2 = load i32* %1, align 4 -; TD1-NEXT: %3 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: %4 = load i32* %3, align 4 -; TD1-NEXT: %5 = add i32 %2, %4 -; TD1-NEXT: ret i32 %5 -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1-NEXT: <DECLAREBLOCKS op0=1/> -; PF1-NEXT: <INST_CAST op0=2 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_CAST op0=4 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_BINOP op0=3 op1=1 op2=0/> -; PF1-NEXT: <INST_RET op0=1/> -; PF1: </FUNCTION_BLOCK> - ; TD2: define i32 @TwoLoads(i32 %i) { ; TD2-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* ; TD2-NEXT: %2 = load i32* %1, align 4 @@ -150,23 +96,6 @@ define i32 @TwoLoadOptOneBlock(i32 %i) { ret i32 %4 } -; TD1: define i32 @TwoLoadOptOneBlock(i32 %i) { -; TD1-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: %2 = load i32* %1, align 4 -; TD1-NEXT: %3 = load i32* %1, align 4 -; TD1-NEXT: %4 = add i32 %2, %3 -; TD1-NEXT: ret i32 %4 -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1-NEXT: <DECLAREBLOCKS op0=1/> -; PF1-NEXT: <INST_CAST op0=2 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_LOAD op0=2 op1=3 op2=0/> -; PF1-NEXT: <INST_BINOP op0=2 op1=1 op2=0/> -; PF1-NEXT: <INST_RET op0=1/> -; PF1: </FUNCTION_BLOCK> - ; TD2: define i32 @TwoLoadOptOneBlock(i32 %i) { ; TD2-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* ; TD2-NEXT: %2 = load i32* %1, align 4 @@ -201,32 +130,6 @@ BB: ret i32 %4 } -; TD1: define i32 @TwoLoadOptTwoBlocks(i32 %i) { -; TD1-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: %2 = load i32* %1, align 4 -; TD1-NEXT: %3 = load i32* %1, align 4 -; TD1-NEXT: %4 = add i32 %2, %3 -; TD1-NEXT: br label %BB -; TD1: BB: -; TD1-NEXT: %5 = load i32* %1, align 4 -; TD1-NEXT: %6 = load i32* %1, align 4 -; TD1-NEXT: %7 = add i32 %5, %6 -; TD1-NEXT: ret i32 %4 -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1-NEXT: <DECLAREBLOCKS op0=2/> -; PF1-NEXT: <INST_CAST op0=2 op1=1 op2=11/> -; PF1-NEXT: <INST_LOAD op0=1 op1=3 op2=0/> -; PF1-NEXT: <INST_LOAD op0=2 op1=3 op2=0/> -; PF1-NEXT: <INST_BINOP op0=2 op1=1 op2=0/> -; PF1-NEXT: <INST_BR op0=1/> -; PF1-NEXT: <INST_LOAD op0=4 op1=3 op2=0/> -; PF1-NEXT: <INST_LOAD op0=5 op1=3 op2=0/> -; PF1-NEXT: <INST_BINOP op0=2 op1=1 op2=0/> -; PF1-NEXT: <INST_RET op0=4/> -; PF1: </FUNCTION_BLOCK> - ; TD2: define i32 @TwoLoadOptTwoBlocks(i32 %i) { ; TD2-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* ; TD2-NEXT: %2 = load i32* %1, align 4 @@ -262,19 +165,6 @@ define void @SimpleStore(i32 %i) { ret void } -; TD1: define void @SimpleStore(i32 %i) { -; TD1-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* -; TD1-NEXT: store i32 %i, i32* %1, align 4 -; TD1-NEXT: ret void -; TD1-NEXT: } - -; PF1: <FUNCTION_BLOCK> -; PF1-NEXT: <DECLAREBLOCKS op0=1/> -; PF1-NEXT: <INST_CAST op0=2 op1=1 op2=11/> -; PF1-NEXT: <INST_STORE op0=1 op1=2 op2=3 op3=0/> -; PF1-NEXT: <INST_RET/> -; PF1: </FUNCTION_BLOCK> - ; TD2: define void @SimpleStore(i32 %i) { ; TD2-NEXT: %1 = bitcast [4 x i8]* @bytes to i32* ; TD2-NEXT: store i32 %i, i32* %1, align 4 |