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) {
10581058 // given the duplication.
10591059 int ThreadingBudget = 0 ;
10601060
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+
10621064 // If the value being substituted on is release there is a chance we could
10631065 // 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,
10651068 DestBB->getArgument (i))) {
10661069 ThreadingBudget = 8 ;
10671070 break ;
10681071 }
10691072
10701073 // If the value being substituted is an enum, check to see if there are any
10711074 // switches on it.
1072- SILValue Arg = BI->getArg (i);
10731075 if (!getEnumCase (Arg, BI->getParent ()) &&
10741076 !isa<IntegerLiteralInst>(Arg))
10751077 continue ;
You can’t perform that action at this time.
0 commit comments