-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
pre-commit: PR115945 #1696
Conversation
runner: buildkitsandbox
velox/Expr.cpp.ll crash |
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 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
/add-label reviewed,regression |
Link: llvm/llvm-project#115945
Requested by: @dtcxzyw