Skip to content

Commit 1b9d8ac

Browse files
JeffBezansonKristofferC
authored andcommitted
speed up llvmcall unique name generation (#35144)
(cherry picked from commit 5d5f799)
1 parent 8ea1225 commit 1b9d8ac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ccall.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,6 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar
849849
}
850850
if (at == NULL)
851851
at = try_eval(ctx, args[3], "error statically evaluating llvmcall argument tuple");
852-
int i = 1;
853852
if (jl_is_tuple(ir)) {
854853
// if the IR is a tuple, we expect (declarations, ir)
855854
if (jl_nfields(ir) != 2)
@@ -908,7 +907,7 @@ static jl_cgval_t emit_llvmcall(jl_codectx_t &ctx, jl_value_t **args, size_t nar
908907
std::string ir_name;
909908
while(true) {
910909
std::stringstream name;
911-
name << (ctx.f->getName().str()) << "u" << i++;
910+
name << (ctx.f->getName().str()) << "u" << globalUnique++;
912911
ir_name = name.str();
913912
if (jl_Module->getFunction(ir_name) == NULL)
914913
break;

0 commit comments

Comments
 (0)