Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit: PR115945 #1696

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

pre-commit: PR115945 #1696

wants to merge 2 commits into from

Conversation

dtcxzyw
Copy link
Owner

@dtcxzyw dtcxzyw commented Nov 15, 2024

Link: llvm/llvm-project#115945
Requested by: @dtcxzyw

@github-actions github-actions bot mentioned this pull request Nov 15, 2024
Copy link
Contributor

runner: buildkitsandbox
baseline runner: cseadmin-PowerEdge-R830
baseline: llvm/llvm-project@59da1af
patch: llvm/llvm-project#115945
sha256: d328b8f83e48993aca460c5c10ebebc4c96c4db2c11e3ecbc2146c28bcf7fa8b
commit: 03a463d
84 files changed, 23240 insertions(+), 23133 deletions(-)

Compilation time result (by files):
Top 5 improvements:
  faiss/sorting.cpp.ll 2737312975 -> 2682824211 -1.99%
  libquic/p224-64.c.ll 10121950763 -> 10094333211 -0.27%
  openmpi/ad_nfs_read.ll 314846615 -> 314296061 -0.17%
  spike/f32_rem.ll 78047962 -> 77943078 -0.13%
  recastnavigation/RecastRasterization.cpp.ll 238372457 -> 238074990 -0.12%
Top 5 regressions:
  darktable/SamsungV0Decompressor.cpp.ll 805391542 -> 900985346 +11.87%
  proj/mlfn.cpp.ll 74339013 -> 76726187 +3.21%
  clamav/consio.cpp.ll 63020601 -> 63999468 +1.55%
  typst-rs/4w2wosufr3zrj3ba.ll 522528365 -> 529413302 +1.32%
  abc/ltl_parser.c.ll 287902968 -> 291225915 +1.15%

Overall: -0.00773396%
Compilation time result (by projects):
Top 5 improvements:
Top 5 regressions:
  nanosvg 3622521963 -> 3627561774 +0.14%
  darktable 134232439007 -> 134375971761 +0.11%

Overall: -0.00229482%
Improvements:
  indvars.NumElimIdentity 1769 -> 1798 +1.64%
  licm.NumAddSubHoisted 896 -> 898 +0.22%
  indvars.NumFoldedUser 1843 -> 1846 +0.16%
  indvars.NumReplaced 99165 -> 99307 +0.14%
  scalar-evolution.NumExitCountsComputed 3663461 -> 3664325 +0.02%
  indvars.NumElimCmp 46860 -> 46869 +0.02%
Regressions:
  div-rem-pairs.NumRecomposed 2830 -> 2822 -0.28%
  licm.NumSunk 249155 -> 248644 -0.21%
  correlated-value-propagation.NumUDivURemsNarrowedExpanded 887 -> 886 -0.11%
  correlated-value-propagation.NumAShrsConverted 3806 -> 3802 -0.11%
  correlated-value-propagation.NumSRems 1199 -> 1198 -0.08%
  simple-loop-unswitch.NumTrivial 2565 -> 2563 -0.08%
  gvn.NumGVNEqProp 338497 -> 338328 -0.05%
  instcombine.NumAggregateReconstructionsSimplified 9229 -> 9225 -0.04%
  scalar-evolution.NumExitCountsNotComputed 11524283 -> 11520504 -0.03%
  instcombine.NegatorNumTreesNegated 35982 -> 35971 -0.03%

velox/Expr.cpp.ll crash
03a463d pre-commit: Update
18 18 bench/abseil-cpp/optimized/hash_test.cc.ll
19 20 bench/cmake/optimized/archive_write_set_format_pax.c.ll
48 44 bench/delta-rs/optimized/2braxl0lj34anf5z.ll
2 2 bench/faiss/optimized/IndexFlat.cpp.ll
207 207 bench/graphviz/optimized/stress.c.ll
43 43 bench/gromacs/optimized/lmmin.cpp.ll
1 1 bench/harfbuzz/optimized/harfbuzz.cc.ll
11 11 bench/hyperscan/optimized/rose_build_add_mask.cpp.ll
101 85 bench/icu/optimized/ustrcase.ll
73 78 bench/imgui/optimized/imgui_tables.cpp.ll
181 182 bench/meshlab/optimized/filter_create.cpp.ll
71 72 bench/openusd/optimized/tessellation.cpp.ll
83 82 bench/php/optimized/phpdbg_cmd.ll
43 45 bench/proj/optimized/mlfn.cpp.ll
6 24 bench/qemu/optimized/hw_usb_hcd-xhci.c.ll
186 187 bench/recastnavigation/optimized/DetourDebugDraw.cpp.ll
14 14 bench/redis/optimized/sentinel.ll
4 4 bench/rust-analyzer-rs/optimized/egul20e4uygvok2.ll
6 6 bench/tree-sitter-rs/optimized/55e7aotywrgrb7st.ll
108 108 bench/typst-rs/optimized/4m3ebbqd1xx21e5m.ll
3 3 bench/wireshark/optimized/packet-gvcp.c.ll

br i1 %cmp16, label %while.cond.backedge, label %if.end18

while.cond.backedge: ; preds = %if.end14, %if.end38
%srcIndex.1.be = phi i32 [ %inc, %if.end14 ], [ %inc39, %if.end38 ]
%indvars.iv.next.pre-phi = phi i64 [ %4, %if.end14 ], [ %10, %if.end38 ]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to reproduce this- with and without the change, the output of opt -O3 ustrcase.ll is the same. Should I be using a different pass pipeline?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also synced my fork to friday (to a commit hash after llvm-opt-benchmark was run), there's no source diff between a version with the phi simplification change and without.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you use the optimized IR? You should use the original IR files under bench/<project>/original/.

With llvm/llvm-project@52361d0:

bin/opt -O3 ../../llvm-opt-benchmark/bench/icu/original/ustrcase.ll -S -o out1.ll
<apply patch and rebuild opt>
bin/opt -O3 ../../llvm-opt-benchmark/bench/icu/original/ustrcase.ll -S -o out2.ll
diff out1.ll out2.ll
992c992
<   br i1 %cmp6149, label %while.body, label %for.end
---
>   br i1 %cmp6149, label %while.body.preheader, label %for.end
994,1000c994,1004
< while.body:                                       ; preds = %while.cond.outer, %while.cond.backedge
<   %srcIndex.1150 = phi i32 [ %srcIndex.1.be, %while.cond.backedge ], [ %srcIndex.1.ph, %while.cond.outer ]
<   %idxprom = sext i32 %srcIndex.1150 to i64
<   %arrayidx = getelementptr inbounds i16, ptr %src, i64 %idxprom
<   %1 = load i16, ptr %arrayidx, align 2
<   %conv = zext i16 %1 to i32
<   %cmp7 = icmp ult i16 %1, 383
---
> while.body.preheader:                             ; preds = %while.cond.outer
>   %1 = sext i32 %srcIndex.1.ph to i64
>   br label %while.body
> 
> while.body:                                       ; preds = %while.body.preheader, %while.cond.backedge
>   %indvars.iv = phi i64 [ %1, %while.body.preheader ], [ %indvars.iv.next.pre-phi, %while.cond.backedge ]
>   %indvars = trunc i64 %indvars.iv to i32
>   %arrayidx = getelementptr inbounds i16, ptr %src, i64 %indvars.iv
>   %2 = load i16, ptr %arrayidx, align 2
>   %conv = zext i16 %2 to i32
>   %cmp7 = icmp ult i16 %2, 383
1004c1008
<   %idxprom9 = zext nneg i16 %1 to i64
---
>   %idxprom9 = zext nneg i16 %2 to i64
1006,1007c1010,1011
<   %2 = load i8, ptr %arrayidx10, align 1
<   %cmp12 = icmp eq i8 %2, -128
---
>   %3 = load i8, ptr %arrayidx10, align 1
>   %cmp12 = icmp eq i8 %3, -128
1011,1012c1015,1017
<   %inc = add nsw i32 %srcIndex.1150, 1
<   %cmp16 = icmp eq i8 %2, 0
---
>   %4 = add nsw i64 %indvars.iv, 1
>   %cmp16 = icmp eq i8 %3, 0
>   %5 = trunc nsw i64 %4 to i32
1016c1021,1022
<   %srcIndex.1.be = phi i32 [ %inc, %if.end14 ], [ %inc39, %if.end38 ]
---
>   %indvars.iv.next.pre-phi = phi i64 [ %4, %if.end14 ], [ %10, %if.end38 ]
>   %srcIndex.1.be = phi i32 [ %5, %if.end14 ], [ %inc39, %if.end38 ]
1021c1027
<   %3 = sext i8 %2 to i16
---
>   %6 = sext i8 %3 to i16
1025c1031
<   %cmp22 = icmp ugt i16 %1, -10241
---
>   %cmp22 = icmp ugt i16 %2, -10241
1029c1035
<   %4 = load ptr, ptr %call, align 8
---
>   %7 = load ptr, ptr %call, align 8
1032,1034c1038,1040
<   %arrayidx28 = getelementptr inbounds i16, ptr %4, i64 %idxprom27
<   %5 = load i16, ptr %arrayidx28, align 2
<   %conv29 = zext i16 %5 to i32
---
>   %arrayidx28 = getelementptr inbounds i16, ptr %7, i64 %idxprom27
>   %8 = load i16, ptr %arrayidx28, align 2
>   %conv29 = zext i16 %8 to i32
1039,1041c1045,1047
<   %arrayidx34 = getelementptr inbounds i16, ptr %4, i64 %idxprom33
<   %6 = load i16, ptr %arrayidx34, align 2
<   %conv35 = zext i16 %6 to i32
---
>   %arrayidx34 = getelementptr inbounds i16, ptr %7, i64 %idxprom33
>   %9 = load i16, ptr %arrayidx34, align 2
>   %conv35 = zext i16 %9 to i32
1047c1053,1054
<   %inc39 = add nsw i32 %srcIndex.1150, 1
---
>   %10 = add nsw i64 %indvars.iv, 1
>   %inc39 = add nsw i32 %indvars, 1
1050c1057
<   %cmp46 = icmp ult i16 %6, 128
---
>   %cmp46 = icmp ult i16 %9, 128
1055c1062,1063
<   %7 = ashr i16 %6, 7
---
>   %11 = trunc nsw i64 %10 to i32
>   %12 = ashr i16 %9, 7
1059,1061c1067,1069
<   %srcIndex.2 = phi i32 [ %inc, %if.end18 ], [ %inc39, %if.end50.loopexit ]
<   %delta.0 = phi i16 [ %3, %if.end18 ], [ %7, %if.end50.loopexit ]
<   %add54 = add i16 %delta.0, %1
---
>   %srcIndex.2 = phi i32 [ %5, %if.end18 ], [ %11, %if.end50.loopexit ]
>   %delta.0 = phi i16 [ %6, %if.end18 ], [ %12, %if.end50.loopexit ]
>   %add54 = add i16 %delta.0, %2
1064,1065c1072,1073
<   %8 = xor i32 %prev.1.ph.ph, -1
<   %sub56 = add i32 %srcIndex.2, %8
---
>   %13 = xor i32 %prev.1.ph.ph, -1
>   %sub56 = add i32 %srcIndex.2, %13
1136c1144
<   %inc71 = add nsw i32 %srcIndex.1150, 1
---
>   %inc71 = add nsw i32 %indvars, 1
1146,1147c1154,1155
<   %9 = load i16, ptr %arrayidx78, align 2
<   %conv79 = zext i16 %9 to i32
---
>   %14 = load i16, ptr %arrayidx78, align 2
>   %conv79 = zext i16 %14 to i32
1156c1164
<   %inc88 = add nsw i32 %srcIndex.1150, 2
---
>   %inc88 = add nsw i32 %indvars, 2
1165c1173
<   store i32 %srcIndex.1150, ptr %cpStart94, align 4
---
>   store i32 %indvars, ptr %cpStart94, align 4
1182c1190
<   %sub103 = sub nsw i32 %srcIndex.1150, %prev.1.ph.ph
---
>   %sub103 = sub nsw i32 %indvars, %prev.1.ph.ph
1218,1220c1226,1228
<   %10 = load ptr, ptr %s, align 8
<   %sub107 = sub nsw i32 %srcIndex.3, %srcIndex.1150
<   %call108 = call fastcc noundef i32 @_ZN6icu_7512_GLOBAL__N_112appendResultEPDsiiiPKDsijPNS_5EditsE(ptr noundef %dest, i32 noundef %retval.0.i94, i32 noundef %destCapacity, i32 noundef %c.1, ptr noundef %10, i32 noundef %sub107, i32 noundef %options, ptr noundef %edits)
---
>   %15 = load ptr, ptr %s, align 8
>   %sub107 = sub nsw i32 %srcIndex.3, %indvars
>   %call108 = call fastcc noundef i32 @_ZN6icu_7512_GLOBAL__N_112appendResultEPDsiiiPKDsijPNS_5EditsE(ptr noundef %dest, i32 noundef %retval.0.i94, i32 noundef %destCapacity, i32 noundef %c.1, ptr noundef %15, i32 noundef %sub107, i32 noundef %options, ptr noundef %edits)
1225c1233
<   %srcIndex.1.lcssa = phi i32 [ %srcIndex.1.be, %while.cond.backedge ], [ %srcIndex.1.ph, %while.cond.outer ]
---
>   %srcIndex.1.lcssa = phi i32 [ %srcLimit, %while.cond.backedge ], [ %srcIndex.1.ph, %while.cond.outer ]
1962c1970
<   br i1 %cmp1139.i, label %while.body.i, label %for.end.i
---
>   br i1 %cmp1139.i, label %while.body.preheader.i, label %for.end.i
1964,1970c1972,1982
< while.body.i:                                     ; preds = %while.cond.outer.i, %while.cond.backedge.i
<   %srcIndex.1140.i = phi i32 [ %srcIndex.1.be.i, %while.cond.backedge.i ], [ %srcIndex.1.ph.i, %while.cond.outer.i ]
<   %idxprom.i = sext i32 %srcIndex.1140.i to i64
<   %arrayidx.i = getelementptr inbounds i16, ptr %src, i64 %idxprom.i
<   %2 = load i16, ptr %arrayidx.i, align 2
<   %conv.i = zext i16 %2 to i32
<   %cmp2.i = icmp ult i16 %2, 383
---
> while.body.preheader.i:                           ; preds = %while.cond.outer.i
>   %2 = sext i32 %srcIndex.1.ph.i to i64
>   br label %while.body.i
> 
> while.body.i:                                     ; preds = %while.cond.backedge.i, %while.body.preheader.i
>   %indvars.iv.i = phi i64 [ %2, %while.body.preheader.i ], [ %indvars.iv.next.pre-phi.i, %while.cond.backedge.i ]
>   %indvars.i = trunc i64 %indvars.iv.i to i32
>   %arrayidx.i = getelementptr inbounds i16, ptr %src, i64 %indvars.iv.i
>   %3 = load i16, ptr %arrayidx.i, align 2
>   %conv.i = zext i16 %3 to i32
>   %cmp2.i = icmp ult i16 %3, 383
1974c1986
<   %idxprom4.i = zext nneg i16 %2 to i64
---
>   %idxprom4.i = zext nneg i16 %3 to i64
1976,1977c1988,1989
<   %3 = load i8, ptr %arrayidx5.i, align 1
<   %cmp7.i = icmp eq i8 %3, -128
---
>   %4 = load i8, ptr %arrayidx5.i, align 1
>   %cmp7.i = icmp eq i8 %4, -128
1981,1982c1993,1995
<   %inc.i = add nsw i32 %srcIndex.1140.i, 1
<   %cmp11.i = icmp eq i8 %3, 0
---
>   %5 = add nsw i64 %indvars.iv.i, 1
>   %cmp11.i = icmp eq i8 %4, 0
>   %6 = trunc nsw i64 %5 to i32
1986c1999,2000
<   %srcIndex.1.be.i = phi i32 [ %inc.i, %if.end9.i ], [ %inc33.i, %if.end32.i ]
---
>   %indvars.iv.next.pre-phi.i = phi i64 [ %5, %if.end9.i ], [ %11, %if.end32.i ]
>   %srcIndex.1.be.i = phi i32 [ %6, %if.end9.i ], [ %inc33.i, %if.end32.i ]
1991c2005
<   %4 = sext i8 %3 to i16
---
>   %7 = sext i8 %4 to i16
1995c2009
<   %cmp17.i = icmp ugt i16 %2, -10241
---
>   %cmp17.i = icmp ugt i16 %3, -10241
1999c2013
<   %5 = load ptr, ptr %call.i, align 8
---
>   %8 = load ptr, ptr %call.i, align 8
2002,2004c2016,2018
<   %arrayidx23.i = getelementptr inbounds i16, ptr %5, i64 %idxprom22.i
<   %6 = load i16, ptr %arrayidx23.i, align 2
<   %conv24.i = zext i16 %6 to i32
---
>   %arrayidx23.i = getelementptr inbounds i16, ptr %8, i64 %idxprom22.i
>   %9 = load i16, ptr %arrayidx23.i, align 2
>   %conv24.i = zext i16 %9 to i32
2009,2011c2023,2025
<   %arrayidx28.i = getelementptr inbounds i16, ptr %5, i64 %idxprom27.i
<   %7 = load i16, ptr %arrayidx28.i, align 2
<   %conv29.i = zext i16 %7 to i32
---
>   %arrayidx28.i = getelementptr inbounds i16, ptr %8, i64 %idxprom27.i
>   %10 = load i16, ptr %arrayidx28.i, align 2
>   %conv29.i = zext i16 %10 to i32
2017c2031,2032
<   %inc33.i = add nsw i32 %srcIndex.1140.i, 1
---
>   %11 = add nsw i64 %indvars.iv.i, 1
>   %inc33.i = add nsw i32 %indvars.i, 1
2020c2035
<   %cmp39.i = icmp ult i16 %7, 128
---
>   %cmp39.i = icmp ult i16 %10, 128
2025c2040,2041
<   %8 = ashr i16 %7, 7
---
>   %12 = trunc nsw i64 %11 to i32
>   %13 = ashr i16 %10, 7
2029,2031c2045,2047
<   %srcIndex.2.i = phi i32 [ %inc.i, %if.end13.i ], [ %inc33.i, %if.end43.loopexit.i ]
<   %delta.0.i = phi i16 [ %4, %if.end13.i ], [ %8, %if.end43.loopexit.i ]
<   %add47.i = add i16 %delta.0.i, %2
---
>   %srcIndex.2.i = phi i32 [ %6, %if.end13.i ], [ %12, %if.end43.loopexit.i ]
>   %delta.0.i = phi i16 [ %7, %if.end13.i ], [ %13, %if.end43.loopexit.i ]
>   %add47.i = add i16 %delta.0.i, %3
2034,2035c2050,2051
<   %9 = xor i32 %prev.1.ph.i.ph, -1
<   %sub49.i = add i32 %srcIndex.2.i, %9
---
>   %14 = xor i32 %prev.1.ph.i.ph, -1
>   %sub49.i = add i32 %srcIndex.2.i, %14
2106,2107c2122,2123
<   %inc64.i = add nsw i32 %srcIndex.1140.i, 1
<   store i32 %srcIndex.1140.i, ptr %cpStart65.i, align 4
---
>   %inc64.i = add nsw i32 %indvars.i, 1
>   store i32 %indvars.i, ptr %cpStart65.i, align 4
2117,2118c2133,2134
<   %10 = load i16, ptr %arrayidx72.i, align 2
<   %conv73.i = zext i16 %10 to i32
---
>   %15 = load i16, ptr %arrayidx72.i, align 2
>   %conv73.i = zext i16 %15 to i32
2127c2143
<   %inc82.i = add nsw i32 %srcIndex.1140.i, 2
---
>   %inc82.i = add nsw i32 %indvars.i, 2
2141c2157
<   %sub91.i = sub nsw i32 %srcIndex.1140.i, %prev.1.ph.i.ph
---
>   %sub91.i = sub nsw i32 %indvars.i, %prev.1.ph.i.ph
2177,2179c2193,2195
<   %11 = load ptr, ptr %s.i, align 8
<   %sub95.i = sub nsw i32 %srcIndex.3.i, %srcIndex.1140.i
<   %call96.i = call fastcc noundef i32 @_ZN6icu_7512_GLOBAL__N_112appendResultEPDsiiiPKDsijPNS_5EditsE(ptr noundef %dest, i32 noundef %retval.0.i84.i, i32 noundef %destCapacity, i32 noundef %call86.i, ptr noundef %11, i32 noundef %sub95.i, i32 noundef %options, ptr noundef %edits)
---
>   %16 = load ptr, ptr %s.i, align 8
>   %sub95.i = sub nsw i32 %srcIndex.3.i, %indvars.i
>   %call96.i = call fastcc noundef i32 @_ZN6icu_7512_GLOBAL__N_112appendResultEPDsiiiPKDsijPNS_5EditsE(ptr noundef %dest, i32 noundef %retval.0.i84.i, i32 noundef %destCapacity, i32 noundef %call86.i, ptr noundef %16, i32 noundef %sub95.i, i32 noundef %options, ptr noundef %edits)
2184c2200
<   %srcIndex.1.lcssa.i = phi i32 [ %srcIndex.1.be.i, %while.cond.backedge.i ], [ %srcIndex.1.ph.i, %while.cond.outer.i ]
---
>   %srcIndex.1.lcssa.i = phi i32 [ %srcLength, %while.cond.backedge.i ], [ %srcIndex.1.ph.i, %while.cond.outer.i ]
2228,2229c2244,2245
<   %12 = load i32, ptr %errorCode, align 4
<   %cmp.i.i14 = icmp sgt i32 %12, 0
---
>   %17 = load i32, ptr %errorCode, align 4
>   %cmp.i.i14 = icmp sgt i32 %17, 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Missed this! Am taking a look at the comment in the main MR now!

@dtcxzyw
Copy link
Owner Author

dtcxzyw commented Nov 15, 2024

/add-label reviewed,regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants