File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1058,18 +1058,20 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
1058
1058
// given the duplication.
1059
1059
int ThreadingBudget = 0 ;
1060
1060
1061
- for (unsigned i = 0 , e = BI->getArgs ().size (); i != e; ++i) {
1061
+ for (unsigned i : indices (BI->getArgs ())) {
1062
+ SILValue Arg = BI->getArg (i);
1063
+
1062
1064
// If the value being substituted on is release there is a chance we could
1063
1065
// remove the release after jump threading.
1064
- if (couldRemoveRelease (SrcBB, BI->getArg (i), DestBB,
1066
+ if (!Arg->getType ().isTrivial (*SrcBB->getParent ()) &&
1067
+ couldRemoveRelease (SrcBB, Arg, DestBB,
1065
1068
DestBB->getArgument (i))) {
1066
1069
ThreadingBudget = 8 ;
1067
1070
break ;
1068
1071
}
1069
1072
1070
1073
// If the value being substituted is an enum, check to see if there are any
1071
1074
// switches on it.
1072
- SILValue Arg = BI->getArg (i);
1073
1075
if (!getEnumCase (Arg, BI->getParent ()) &&
1074
1076
!isa<IntegerLiteralInst>(Arg))
1075
1077
continue ;
You can’t perform that action at this time.
0 commit comments