1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
Florian Hahn c5b8c59aa2 [SCCP] Switch to widen at PHIs, stores and call edges.
Currently SCCP does not widen PHIs, stores or along call edges
(arguments/return values), but on operations that directly extend ranges
(like binary operators).

This means PHIs, stores and call edges are not pessimized by widening
currently, while binary operators are. The main reason for widening
operators initially was that opting-out for certain operations was
more straight-forward in the initial implementation (and it did not
matter too much, as range support initially was only implemented for a
very limited set of operations.

During the discussion in D78391, it was suggested to consider flipping
widening to PHIs, stores and along call edges. After adding support for
tracking the number of range extensions in ValueLattice, limiting the
number of range extensions per value is straight forward.

This patch introduces a MaxWidenSteps option to the MergeOptions,
limiting the number of range extensions per value. For PHIs, it seems
natural allow an extension for each (active) incoming value plus 1. For
the other cases, a arbitrary limit of 10 has been chosen initially. It would
potentially make sense to set it depending on the users of a
function/global, but that still needs investigating. This potentially
leads to more state-changes and longer compile-times.

The results look quite promising (MultiSource, SPEC):

Same hash: 179 (filtered out)
Remaining: 58
Metric: sccp.IPNumInstRemoved

Program                                        base    widen-phi diff
 test-suite...ks/Prolangs-C/agrep/agrep.test    58.00   82.00    41.4%
 test-suite...marks/SciMark2-C/scimark2.test    32.00   43.00    34.4%
 test-suite...rks/FreeBench/mason/mason.test     6.00    8.00    33.3%
 test-suite...langs-C/football/football.test   104.00  128.00    23.1%
 test-suite...cations/hexxagon/hexxagon.test    36.00   42.00    16.7%
 test-suite...CFP2000/177.mesa/177.mesa.test   214.00  249.00    16.4%
 test-suite...ngs-C/assembler/assembler.test    14.00   16.00    14.3%
 test-suite...arks/VersaBench/dbms/dbms.test    10.00   11.00    10.0%
 test-suite...oxyApps-C++/miniFE/miniFE.test    43.00   47.00     9.3%
 test-suite...ications/JM/ldecod/ldecod.test   179.00  195.00     8.9%
 test-suite...CFP2006/433.milc/433.milc.test   249.00  265.00     6.4%
 test-suite.../CINT2000/175.vpr/175.vpr.test    98.00  104.00     6.1%
 test-suite...peg2/mpeg2dec/mpeg2decode.test    70.00   74.00     5.7%
 test-suite...CFP2000/188.ammp/188.ammp.test    71.00   75.00     5.6%
 test-suite...ce/Benchmarks/PAQ8p/paq8p.test   111.00  117.00     5.4%
 test-suite...ce/Applications/Burg/burg.test    41.00   43.00     4.9%
 test-suite...000/197.parser/197.parser.test    66.00   69.00     4.5%
 test-suite...tions/lambda-0.1.3/lambda.test    23.00   24.00     4.3%
 test-suite...urce/Applications/lua/lua.test   301.00  313.00     4.0%
 test-suite...TimberWolfMC/timberwolfmc.test    76.00   79.00     3.9%
 test-suite...lications/ClamAV/clamscan.test   991.00  1030.00    3.9%
 test-suite...plications/d/make_dparser.test    53.00   55.00     3.8%
 test-suite...fice-ispell/office-ispell.test    83.00   86.00     3.6%
 test-suite...lications/obsequi/Obsequi.test    28.00   29.00     3.6%
 test-suite.../Prolangs-C/bison/mybison.test    56.00   58.00     3.6%
 test-suite.../CINT2000/254.gap/254.gap.test   170.00  176.00     3.5%
 test-suite.../Applications/lemon/lemon.test    30.00   31.00     3.3%
 test-suite.../CINT2000/176.gcc/176.gcc.test   1202.00 1240.00    3.2%
 test-suite...pplications/treecc/treecc.test    79.00   81.00     2.5%
 test-suite...chmarks/MallocBench/gs/gs.test   357.00  366.00     2.5%
 test-suite...eeBench/analyzer/analyzer.test   103.00  105.00     1.9%
 test-suite...T2006/445.gobmk/445.gobmk.test   1697.00 1724.00    1.6%
 test-suite...006/453.povray/453.povray.test   1812.00 1839.00    1.5%
 test-suite.../Benchmarks/Bullet/bullet.test   337.00  342.00     1.5%
 test-suite.../CINT2000/252.eon/252.eon.test   426.00  432.00     1.4%
 test-suite...T2000/300.twolf/300.twolf.test   214.00  217.00     1.4%
 test-suite...pplications/oggenc/oggenc.test   244.00  247.00     1.2%
 test-suite.../CINT2006/403.gcc/403.gcc.test   4008.00 4055.00    1.2%
 test-suite...T2006/456.hmmer/456.hmmer.test   175.00  177.00     1.1%
 test-suite...nal/skidmarks10/skidmarks.test   430.00  434.00     0.9%
 test-suite.../Applications/sgefa/sgefa.test   115.00  116.00     0.9%
 test-suite...006/447.dealII/447.dealII.test   1082.00 1091.00    0.8%
 test-suite...6/482.sphinx3/482.sphinx3.test   141.00  142.00     0.7%
 test-suite...ocBench/espresso/espresso.test   152.00  153.00     0.7%
 test-suite...3.xalancbmk/483.xalancbmk.test   4003.00 4025.00    0.5%
 test-suite...lications/sqlite3/sqlite3.test   548.00  551.00     0.5%
 test-suite...marks/7zip/7zip-benchmark.test   5522.00 5551.00    0.5%
 test-suite...nsumer-lame/consumer-lame.test   208.00  209.00     0.5%
 test-suite...:: External/Povray/povray.test   1556.00 1563.00    0.4%
 test-suite...000/186.crafty/186.crafty.test   298.00  299.00     0.3%
 test-suite.../Applications/SPASS/SPASS.test   2019.00 2025.00    0.3%
 test-suite...ications/JM/lencod/lencod.test   8427.00 8449.00    0.3%
 test-suite...6/464.h264ref/464.h264ref.test   6797.00 6813.00    0.2%
 test-suite...6/471.omnetpp/471.omnetpp.test   431.00  430.00    -0.2%
 test-suite...006/450.soplex/450.soplex.test   446.00  447.00     0.2%
 test-suite...0.perlbench/400.perlbench.test   1729.00 1727.00   -0.1%
 test-suite...000/255.vortex/255.vortex.test   3815.00 3819.00    0.1%

Reviewers: efriedma, nikic, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D79036
2020-05-29 11:59:17 +01:00

424 lines
13 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt -ipsccp -S %s | FileCheck %s
%t1 = type opaque
@e = common global i32 0, align 4
; Test that we a skip unknown values depending on a unknown tracked call, until the call gets resolved. The @test1 and @test2 variants are very similar, they just check 2 different kinds of users (icmp and zext)
define i32 @test1_m(i32 %h) {
; CHECK-LABEL: define {{[^@]+}}@test1_m
; CHECK-SAME: (i32 [[H:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = trunc i32 [[H]] to i8
; CHECK-NEXT: [[CALL:%.*]] = call i32 @test1_k(i8 [[CONV]], i32 0)
; CHECK-NEXT: [[CONV1:%.*]] = sext i32 [[H]] to i64
; CHECK-NEXT: [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
; CHECK-NEXT: [[CALL2:%.*]] = call i1 @test1_g(%t1* [[TMP0]], i32 1)
; CHECK-NEXT: ret i32 undef
;
entry:
%conv = trunc i32 %h to i8
%call = call i32 @test1_k(i8 %conv, i32 0)
%conv1 = sext i32 %h to i64
%0 = inttoptr i64 %conv1 to %t1*
%call2 = call i1 @test1_g(%t1* %0, i32 1)
ret i32 undef
; uselistorder directives
uselistorder i32 %h, { 1, 0 }
}
declare void @use.1(i1)
define internal i32 @test1_k(i8 %h, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test1_k
; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @e, align 4
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
; CHECK-NEXT: [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
; CHECK-NEXT: [[CALL:%.*]] = call i1 @test1_g(%t1* [[TMP1]], i32 0)
; CHECK-NEXT: call void @use.1(i1 false)
; CHECK-NEXT: ret i32 undef
;
entry:
%0 = load i32, i32* @e, align 4
%conv = sext i32 %0 to i64
%1 = inttoptr i64 %conv to %t1*
%call = call i1 @test1_g(%t1* %1, i32 %i)
%frombool.1 = zext i1 %call to i8
%tobool.1 = trunc i8 %frombool.1 to i1
call void @use.1(i1 %tobool.1)
ret i32 undef
}
define internal i1 @test1_g(%t1* %h, i32 %i) #0 {
; CHECK-LABEL: define {{[^@]+}}@test1_g
; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
; CHECK: land.rhs:
; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @test1_j()
; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp ne i32 [[CALL]], 0
; CHECK-NEXT: br label [[LAND_END]]
; CHECK: land.end:
; CHECK-NEXT: [[TMP0:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL1]], [[LAND_RHS]] ]
; CHECK-NEXT: ret i1 undef
;
entry:
%tobool = icmp ne i32 %i, 0
br i1 %tobool, label %land.rhs, label %land.end
land.rhs: ; preds = %entry
%call = call i32 (...) @test1_j()
%tobool1 = icmp ne i32 %call, 0
br label %land.end
land.end: ; preds = %land.rhs, %entry
%0 = phi i1 [ false, %entry ], [ %tobool1, %land.rhs ]
ret i1 false
}
declare i32 @test1_j(...)
define i32 @test2_m(i32 %h) #0 {
; CHECK-LABEL: define {{[^@]+}}@test2_m
; CHECK-SAME: (i32 [[H:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = trunc i32 [[H]] to i8
; CHECK-NEXT: [[CALL:%.*]] = call i32 @test2_k(i8 [[CONV]], i32 0)
; CHECK-NEXT: [[CONV1:%.*]] = sext i32 [[H]] to i64
; CHECK-NEXT: [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
; CHECK-NEXT: [[CALL2:%.*]] = call i1 @test2_g(%t1* [[TMP0]], i32 1)
; CHECK-NEXT: ret i32 undef
;
entry:
%conv = trunc i32 %h to i8
%call = call i32 @test2_k(i8 %conv, i32 0)
%conv1 = sext i32 %h to i64
%0 = inttoptr i64 %conv1 to %t1*
%call2 = call i1 @test2_g(%t1* %0, i32 1)
ret i32 undef
; uselistorder directives
uselistorder i32 %h, { 1, 0 }
}
; TODO: We could do better for the return value of call i1 @test3_g, if we
; resolve the unknown values there first.
define internal i32 @test2_k(i8 %h, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test2_k
; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @e, align 4
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
; CHECK-NEXT: [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
; CHECK-NEXT: [[CALL:%.*]] = call i1 @test3_g(%t1* [[TMP1]], i32 0)
; CHECK-NEXT: call void @use.1(i1 false)
; CHECK-NEXT: ret i32 undef
;
entry:
%0 = load i32, i32* @e, align 4
%conv = sext i32 %0 to i64
%1 = inttoptr i64 %conv to %t1*
%call = call i1 @test3_g(%t1* %1, i32 %i)
%frombool = icmp slt i1 %call, 1
%add = add i1 %frombool, %frombool
call void @use.1(i1 %frombool)
ret i32 undef
}
define internal i1 @test2_g(%t1* %h, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test2_g
; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 true, label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
; CHECK: land.rhs:
; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @test2_j()
; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp ne i32 [[CALL]], 0
; CHECK-NEXT: br label [[LAND_END]]
; CHECK: land.end:
; CHECK-NEXT: [[TMP0:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL1]], [[LAND_RHS]] ]
; CHECK-NEXT: ret i1 undef
;
entry:
%tobool = icmp ne i32 %i, 0
br i1 %tobool, label %land.rhs, label %land.end
land.rhs: ; preds = %entry
%call = call i32 (...) @test2_j()
%tobool1 = icmp ne i32 %call, 0
br label %land.end
land.end: ; preds = %land.rhs, %entry
%0 = phi i1 [ false, %entry ], [ %tobool1, %land.rhs ]
ret i1 false
}
declare i32 @test2_j(...)
; Same as test_2*, but with a PHI node depending on a tracked call result.
define i32 @test3_m(i32 %h) #0 {
; CHECK-LABEL: define {{[^@]+}}@test3_m
; CHECK-SAME: (i32 [[H:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = trunc i32 [[H]] to i8
; CHECK-NEXT: [[CALL:%.*]] = call i32 @test3_k(i8 [[CONV]], i32 0)
; CHECK-NEXT: [[CONV1:%.*]] = sext i32 [[H]] to i64
; CHECK-NEXT: [[TMP0:%.*]] = inttoptr i64 [[CONV1]] to %t1*
; CHECK-NEXT: [[CALL2:%.*]] = call i1 @test3_g(%t1* [[TMP0]], i32 1)
; CHECK-NEXT: ret i32 undef
;
entry:
%conv = trunc i32 %h to i8
%call = call i32 @test3_k(i8 %conv, i32 0)
%conv1 = sext i32 %h to i64
%0 = inttoptr i64 %conv1 to %t1*
%call2 = call i1 @test3_g(%t1* %0, i32 1)
ret i32 undef
; uselistorder directives
uselistorder i32 %h, { 1, 0 }
}
define internal i32 @test3_k(i8 %h, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test3_k
; CHECK-SAME: (i8 [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @e, align 4
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
; CHECK-NEXT: [[TMP1:%.*]] = inttoptr i64 [[CONV]] to %t1*
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: loop:
; CHECK-NEXT: [[PHI:%.*]] = phi i1 [ undef, [[ENTRY:%.*]] ], [ false, [[LOOP]] ]
; CHECK-NEXT: [[CALL:%.*]] = call i1 @test3_g(%t1* [[TMP1]], i32 0)
; CHECK-NEXT: call void @use.1(i1 false)
; CHECK-NEXT: br i1 false, label [[LOOP]], label [[EXIT:%.*]]
; CHECK: exit:
; CHECK-NEXT: ret i32 undef
;
entry:
%0 = load i32, i32* @e, align 4
%conv = sext i32 %0 to i64
%1 = inttoptr i64 %conv to %t1*
br label %loop
loop:
%phi = phi i1 [ undef, %entry], [ %call, %loop ]
%call = call i1 @test3_g(%t1* %1, i32 %i)
%frombool = icmp slt i1 %call, 1
%add = add i1 %frombool, %frombool
call void @use.1(i1 %frombool)
br i1 %call, label %loop, label %exit
exit:
ret i32 undef
}
define internal i1 @test3_g(%t1* %h, i32 %i) {
; CHECK-LABEL: define {{[^@]+}}@test3_g
; CHECK-SAME: (%t1* [[H:%.*]], i32 [[I:%.*]])
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[I]], 0
; CHECK-NEXT: br i1 [[TOBOOL]], label [[LAND_RHS:%.*]], label [[LAND_END:%.*]]
; CHECK: land.rhs:
; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @test3_j()
; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp ne i32 [[CALL]], 0
; CHECK-NEXT: br label [[LAND_END]]
; CHECK: land.end:
; CHECK-NEXT: [[TMP0:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[TOBOOL1]], [[LAND_RHS]] ]
; CHECK-NEXT: ret i1 undef
;
entry:
%tobool = icmp ne i32 %i, 0
br i1 %tobool, label %land.rhs, label %land.end
land.rhs: ; preds = %entry
%call = call i32 (...) @test3_j()
%tobool1 = icmp ne i32 %call, 0
br label %land.end
land.end: ; preds = %land.rhs, %entry
%0 = phi i1 [ false, %entry ], [ %tobool1, %land.rhs ]
ret i1 false
}
declare i32 @test3_j(...)
; TODO: We can eliminate the bitcast, if we resolve the unknown argument of
; @test4_b first.
declare void @use.16(i16*)
declare void @use.8(i8*)
define void @test4_a() {
; CHECK-LABEL: define {{[^@]+}}@test4_a()
; CHECK-NEXT: bb:
; CHECK-NEXT: [[TMP:%.*]] = call i8* @test4_c(i8* null)
; CHECK-NEXT: call void @test4_b(i8* null)
; CHECK-NEXT: ret void
;
bb:
%tmp = call i8* @test4_c(i8* null)
call void @test4_b(i8* %tmp)
ret void
}
define internal void @test4_b(i8* %arg) {
; CHECK-LABEL: define {{[^@]+}}@test4_b
; CHECK-SAME: (i8* [[ARG:%.*]])
; CHECK-NEXT: bb:
; CHECK-NEXT: [[TMP:%.*]] = bitcast i8* null to i16*
; CHECK-NEXT: call void @use.16(i16* [[TMP]])
; CHECK-NEXT: call void @use.8(i8* null)
; CHECK-NEXT: ret void
;
bb:
%tmp = bitcast i8* %arg to i16*
%sel = select i1 false, i8* %arg, i8* %arg
call void @use.16(i16* %tmp)
call void @use.8(i8* %sel)
ret void
}
define internal i8* @test4_c(i8* %arg) {
; CHECK-LABEL: define {{[^@]+}}@test4_c
; CHECK-SAME: (i8* [[ARG:%.*]])
; CHECK-NEXT: bb1:
; CHECK-NEXT: [[TMP:%.*]] = and i1 undef, undef
; CHECK-NEXT: br i1 [[TMP]], label [[BB3:%.*]], label [[BB2:%.*]]
; CHECK: bb2:
; CHECK-NEXT: unreachable
; CHECK: bb3:
; CHECK-NEXT: ret i8* undef
;
bb1: ; preds = %bb
%tmp = and i1 undef, undef
br i1 %tmp, label %bb3, label %bb2
bb2: ; preds = %bb1
unreachable
bb3: ; preds = %bb1
ret i8* null
}
; TODO: Same as test4, but with a select instead of a bitcast.
define void @test5_a() {
; CHECK-LABEL: define {{[^@]+}}@test5_a()
; CHECK-NEXT: bb:
; CHECK-NEXT: [[TMP:%.*]] = call i8* @test5_c(i8* null)
; CHECK-NEXT: call void @test5_b(i8* null)
; CHECK-NEXT: ret void
;
bb:
%tmp = call i8* @test5_c(i8* null)
call void @test5_b(i8* %tmp)
ret void
}
define internal void @test5_b(i8* %arg) {
; CHECK-LABEL: define {{[^@]+}}@test5_b
; CHECK-SAME: (i8* [[ARG:%.*]])
; CHECK-NEXT: bb:
; CHECK-NEXT: [[SEL:%.*]] = select i1 false, i8* null, i8* null
; CHECK-NEXT: call void @use.8(i8* [[SEL]])
; CHECK-NEXT: ret void
;
bb:
%sel = select i1 false, i8* %arg, i8* %arg
call void @use.8(i8* %sel)
ret void
}
define internal i8* @test5_c(i8* %arg) {
; CHECK-LABEL: define {{[^@]+}}@test5_c
; CHECK-SAME: (i8* [[ARG:%.*]])
; CHECK-NEXT: bb1:
; CHECK-NEXT: [[TMP:%.*]] = and i1 undef, undef
; CHECK-NEXT: br i1 [[TMP]], label [[BB3:%.*]], label [[BB2:%.*]]
; CHECK: bb2:
; CHECK-NEXT: unreachable
; CHECK: bb3:
; CHECK-NEXT: ret i8* undef
;
bb1: ; preds = %bb
%tmp = and i1 undef, undef
br i1 %tmp, label %bb3, label %bb2
bb2: ; preds = %bb1
unreachable
bb3: ; preds = %bb1
ret i8* null
}
@contextsize = external dso_local local_unnamed_addr global i32, align 4
@pcount = internal local_unnamed_addr global i32 0, align 4
@maxposslen = external dso_local local_unnamed_addr global i32, align 4
define void @test3() {
; CHECK-LABEL: define {{[^@]+}}@test3()
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[IF_END16:%.*]]
; CHECK: if.end16:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @contextsize, align 4
; CHECK-NEXT: [[SUB18:%.*]] = sub i32 undef, [[TMP0]]
; CHECK-NEXT: [[SUB19:%.*]] = sub i32 [[SUB18]], undef
; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* @maxposslen, align 4
; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], 8
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 undef, [[ADD]]
; CHECK-NEXT: [[TMP2:%.*]] = load i32, i32* @pcount, align 4
; CHECK-NEXT: [[MUL:%.*]] = mul nsw i32 [[DIV]], [[SUB19]]
; CHECK-NEXT: [[CMP20:%.*]] = icmp sgt i32 [[TMP2]], [[MUL]]
; CHECK-NEXT: br i1 [[CMP20]], label [[IF_THEN22:%.*]], label [[IF_END24:%.*]]
; CHECK: if.then22:
; CHECK-NEXT: store i32 [[MUL]], i32* @pcount, align 4
; CHECK-NEXT: ret void
; CHECK: if.end24:
; CHECK-NEXT: br label [[FOR_END:%.*]]
; CHECK: for.end:
; CHECK-NEXT: ret void
;
entry:
br label %if.end16
if.end16: ; preds = %entry
%0 = load i32, i32* @contextsize, align 4
%sub18 = sub i32 undef, %0
%sub19 = sub i32 %sub18, undef
%1 = load i32, i32* @maxposslen, align 4
%add = add nsw i32 %1, 8
%div = sdiv i32 undef, %add
%2 = load i32, i32* @pcount, align 4
%mul = mul nsw i32 %div, %sub19
%cmp20 = icmp sgt i32 %2, %mul
br i1 %cmp20, label %if.then22, label %if.end24
if.then22: ; preds = %if.end16
store i32 %mul, i32* @pcount, align 4
ret void
if.end24: ; preds = %if.end16
%cmp25474 = icmp sgt i32 %2, 0
br i1 %cmp25474, label %for.body, label %for.end
for.body: ; preds = %if.end24
%3 = trunc i64 0 to i32
%div30 = sdiv i32 %3, %sub19
ret void
for.end: ; preds = %if.end24
ret void
}