Disable Subzero IR generation for performance testing.
This CL allows one to time Subzero's bitcode parsing without IR generation
(other than types, function declarations, and uninitialized global variables)
for performance testing.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/696383004
diff --git a/tests_lit/lit.cfg b/tests_lit/lit.cfg
index d431d1f..3c70753 100644
--- a/tests_lit/lit.cfg
+++ b/tests_lit/lit.cfg
@@ -79,8 +79,7 @@
# shell conditional commands.
if_atts = [os.path.join(pydir, 'if.py')]
-if_atts_cmd = if_atts + ['--have=' + att
- for att in llvm2iceatts] + ['--command']
+if_atts_cmd = if_atts + ['--have=' + att for att in llvm2iceatts]
ifl2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir' in llvm2iceatts),
'--command']
iflc2i_atts_cmd = if_atts + [if_cond_flag('allow_llvm_ir_as_input'
diff --git a/tests_lit/reader_tests/alloca.ll b/tests_lit/reader_tests/alloca.ll
index fd1dea3..0a314e0 100644
--- a/tests_lit/reader_tests/alloca.ll
+++ b/tests_lit/reader_tests/alloca.ll
@@ -1,6 +1,10 @@
; Test if we can read alloca instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
; Show examples where size is defined by a constant.
@@ -159,3 +163,5 @@
; CHECK-NEXT: %array = alloca i8, i32 %n, align 16
; CHECK-NEXT: ret i32 %array
}
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/binops.ll b/tests_lit/reader_tests/binops.ll
index 785d482..65ed55e 100644
--- a/tests_lit/reader_tests/binops.ll
+++ b/tests_lit/reader_tests/binops.ll
@@ -3,6 +3,10 @@
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
; TODO(kschimpf): add i8/i16. Needs bitcasts.
@@ -965,3 +969,5 @@
; CHECK-NEXT: %lshr = lshr <4 x i32> %b, %a
; CHECK-NEXT: ret <4 x i32> %lshr
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/branch.ll b/tests_lit/reader_tests/branch.ll
index 46b7ffa..b68a016 100644
--- a/tests_lit/reader_tests/branch.ll
+++ b/tests_lit/reader_tests/branch.ll
@@ -1,6 +1,10 @@
; Tests if we handle a branch instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @SimpleBranch() {
entry:
@@ -43,3 +47,5 @@
; CHECK-NEXT: b2:
; CHECK-NEXT: br i1 %test, label %b2, label %b1
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/call-indirect.ll b/tests_lit/reader_tests/call-indirect.ll
index 35f73e3..3da87dd 100644
--- a/tests_lit/reader_tests/call-indirect.ll
+++ b/tests_lit/reader_tests/call-indirect.ll
@@ -1,6 +1,10 @@
; Test parsing indirect calls in Subzero.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define internal void @CallIndirectVoid(i32 %f_addr) {
entry:
@@ -27,3 +31,5 @@
; CHECK-NEXT: %r = call i32 %f_addr(i8 1, i1 false)
; CHECK-NEXT: ret i32 %r
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/call.ll b/tests_lit/reader_tests/call.ll
index ffe5e04..95227a6 100644
--- a/tests_lit/reader_tests/call.ll
+++ b/tests_lit/reader_tests/call.ll
@@ -1,6 +1,10 @@
; Test handling of call instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define i32 @fib(i32 %n) {
entry:
@@ -106,3 +110,4 @@
; CHECK-NEXT: ret void
; CHECK-NEXT: }
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/casts.ll b/tests_lit/reader_tests/casts.ll
index 26dc8b7..2bf76eb 100644
--- a/tests_lit/reader_tests/casts.ll
+++ b/tests_lit/reader_tests/casts.ll
@@ -1,6 +1,10 @@
; Tests if we can read cast operations.
; RUN: %p2i -i %s --insts --no-local-syms | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
; TODO(kschimpf) Find way to test pointer conversions (since they in general
; get removed by pnacl-freeze).
@@ -532,3 +536,5 @@
; CHECK-NEXT: %__3 = bitcast <16 x i8> %__0 to <8 x i16>
; CHECK-NEXT: ret void
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/compare.ll b/tests_lit/reader_tests/compare.ll
index 51eb581..7c92f51 100644
--- a/tests_lit/reader_tests/compare.ll
+++ b/tests_lit/reader_tests/compare.ll
@@ -1,6 +1,10 @@
; Test if we can read compare instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define i1 @IcmpI1(i32 %p1, i32 %p2) {
entry:
@@ -469,3 +473,5 @@
; CHECK-NEXT: %vtrue = fcmp true <4 x float> %a1, %a2
; CHECK-NEXT: ret <4 x i1> %voeq
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/constants.ll b/tests_lit/reader_tests/constants.ll
index feb7dcd..d8127e6 100644
--- a/tests_lit/reader_tests/constants.ll
+++ b/tests_lit/reader_tests/constants.ll
@@ -1,6 +1,10 @@
; Test handling of constants in function blocks.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @TestIntegers() {
entry:
@@ -152,3 +156,5 @@
ret void
; CHECK-NEXT: ret void
}
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/forwardref.ll b/tests_lit/reader_tests/forwardref.ll
index b938b6c..86b41b7 100644
--- a/tests_lit/reader_tests/forwardref.ll
+++ b/tests_lit/reader_tests/forwardref.ll
@@ -1,9 +1,12 @@
; Test use forward type references in function blocks.
; RUN: %p2i -i %s --insts | FileCheck %s
-
; RUN: llvm-as < %s | pnacl-freeze | pnacl-bcdis -no-records \
; RUN: | FileCheck --check-prefix=DUMP %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @LoopCarriedDep() {
b0:
@@ -116,3 +119,5 @@
; DUMP-NEXT: %b6:
; DUMP-NEXT: ret void; <@a3>
; DUMP-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/globalinit.pnacl.ll b/tests_lit/reader_tests/globalinit.pnacl.ll
index 6d4c9aa..0d92351 100644
--- a/tests_lit/reader_tests/globalinit.pnacl.ll
+++ b/tests_lit/reader_tests/globalinit.pnacl.ll
@@ -3,6 +3,10 @@
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
@PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
; CHECK: @PrimitiveInit = internal global [4 x i8] c"\1B\00\00\00", align 4
@@ -74,3 +78,5 @@
%result = sub i32 0, %size
ret i32 %result
}
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/globalrelocs.ll b/tests_lit/reader_tests/globalrelocs.ll
index 6634890..a6a44f7 100644
--- a/tests_lit/reader_tests/globalrelocs.ll
+++ b/tests_lit/reader_tests/globalrelocs.ll
@@ -3,6 +3,10 @@
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
@bytes = internal global [7 x i8] c"abcdefg"
; CHECK: @bytes = internal global [7 x i8] c"abcdefg"
@@ -95,3 +99,4 @@
; CHECK-NEXT: define void @func() {
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/insertextract.ll b/tests_lit/reader_tests/insertextract.ll
index 7116109..ca01469 100644
--- a/tests_lit/reader_tests/insertextract.ll
+++ b/tests_lit/reader_tests/insertextract.ll
@@ -3,6 +3,10 @@
; RUN: %p2i -i %s --insts | FileCheck %s
; RUN: %l2i -i %s --insts | %ifl FileCheck %s
; RUN: %lc2i -i %s --insts | %iflc FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @ExtractV4xi1(<4 x i1> %v) {
entry:
@@ -377,3 +381,5 @@
; CHECK-NEXT: %r3 = insertelement <4 x float> %v, float %e, i32 3
; CHECK-NEXT: ret <4 x float> %r3
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/load.ll b/tests_lit/reader_tests/load.ll
index 7b579d3..75591ae 100644
--- a/tests_lit/reader_tests/load.ll
+++ b/tests_lit/reader_tests/load.ll
@@ -1,6 +1,10 @@
; Test if we can read load instructions.
; RUN: %p2i --no-local-syms -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define i32 @load_i8(i32 %addr) {
entry:
@@ -144,3 +148,4 @@
; CHECK-NEXT: ret <4 x float> %__1
}
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/nacl-atomic-intrinsics.ll b/tests_lit/reader_tests/nacl-atomic-intrinsics.ll
index bc9011e..b59b380 100644
--- a/tests_lit/reader_tests/nacl-atomic-intrinsics.ll
+++ b/tests_lit/reader_tests/nacl-atomic-intrinsics.ll
@@ -1,6 +1,10 @@
; Test parsing NaCl atomic instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
declare i8 @llvm.nacl.atomic.load.i8(i8*, i32)
declare i16 @llvm.nacl.atomic.load.i16(i16*, i32)
@@ -638,3 +642,4 @@
; CHECK-NEXT: ret i32 %r
; CHECK-NEXT: }
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/nacl-other-intrinsics.ll b/tests_lit/reader_tests/nacl-other-intrinsics.ll
index eda03a3..aac2c25 100644
--- a/tests_lit/reader_tests/nacl-other-intrinsics.ll
+++ b/tests_lit/reader_tests/nacl-other-intrinsics.ll
@@ -1,6 +1,10 @@
; This tests parsing NaCl intrinsics not related to atomic operations.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
declare i8* @llvm.nacl.read.tp()
declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
@@ -339,3 +343,4 @@
; CHECK-NEXT: ret void
; CHECK-NEXT: }
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/phi.ll b/tests_lit/reader_tests/phi.ll
index 3799d4b..a90bc4c 100644
--- a/tests_lit/reader_tests/phi.ll
+++ b/tests_lit/reader_tests/phi.ll
@@ -1,6 +1,10 @@
; Test reading phi instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
; TODO(kschimpf) Add forward reference examples.
@@ -28,3 +32,4 @@
; CHECK-NEXT: ret i32 %result
; CHECK-NEXT: }
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/select.ll b/tests_lit/reader_tests/select.ll
index 8177fa3..8421084 100644
--- a/tests_lit/reader_tests/select.ll
+++ b/tests_lit/reader_tests/select.ll
@@ -1,6 +1,10 @@
; Tests if we can read select instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @Seli1(i32 %p) {
entry:
@@ -293,3 +297,5 @@
; CHECK-NEXT: %r = select <4 x i1> %pc, <4 x float> %pt, <4 x float> %pe
; CHECK-NEXT: ret <4 x float> %r
; CHECK-NEXT: }
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/store.ll b/tests_lit/reader_tests/store.ll
index c507175..091e763 100644
--- a/tests_lit/reader_tests/store.ll
+++ b/tests_lit/reader_tests/store.ll
@@ -1,6 +1,10 @@
; Test if we can read store instructions.
; RUN: %p2i -i %s --insts --no-local-syms | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @store_i8(i32 %addr) {
entry:
@@ -133,3 +137,5 @@
; CHECK-NEXT: store <4 x float> %__1, <4 x float>* %__0, align 4
; CHECK-NEXT: ret void
}
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/switch.ll b/tests_lit/reader_tests/switch.ll
index bb60e55..0bbbf88 100644
--- a/tests_lit/reader_tests/switch.ll
+++ b/tests_lit/reader_tests/switch.ll
@@ -1,6 +1,10 @@
; Test switch instructions.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define void @testDefaultSwitch(i32 %a) {
entry:
@@ -490,3 +494,4 @@
; CHECK-NEXT: ret void
; CHECK-NEXT: }
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/unnamed.ll b/tests_lit/reader_tests/unnamed.ll
index 87dccd6..3f84b01 100644
--- a/tests_lit/reader_tests/unnamed.ll
+++ b/tests_lit/reader_tests/unnamed.ll
@@ -12,6 +12,11 @@
; RUN: -default-function-prefix=h -default-global-prefix=g \
; RUN: | FileCheck --check-prefix=BAD %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
+
; TODO(kschimpf) Check global variable declarations, once generated.
@0 = internal global [4 x i8] zeroinitializer, align 4
@@ -57,3 +62,5 @@
; BAD: Warning : Default global prefix 'g' potentially conflicts with name 'g'.
; BAD: Warning : Default function prefix 'h' potentially conflicts with name 'h5'.
+
+; NOIR: Total across all functions
diff --git a/tests_lit/reader_tests/unreachable.ll b/tests_lit/reader_tests/unreachable.ll
index 4cd2f9d..7f12187 100644
--- a/tests_lit/reader_tests/unreachable.ll
+++ b/tests_lit/reader_tests/unreachable.ll
@@ -1,6 +1,10 @@
; Test parsing unreachable instruction.
; RUN: %p2i -i %s --insts | FileCheck %s
+; RUN: %if --need=allow_disable_ir_gen --command \
+; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \
+; RUN: | %if --need=allow_disable_ir_gen --command \
+; RUN: FileCheck --check-prefix=NOIR %s
define internal i32 @divide(i32 %num, i32 %den) {
entry:
@@ -25,3 +29,5 @@
; CHECK-NEXT: %div = sdiv i32 %num, %den
; CHECK-NEXT: ret i32 %div
; CHECK-NEXT: }
+
+; NOIR: Total across all functions