I'm assuming is that bugpoint repros should behave the same before and after -metarenamer.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Not sure that I understand. Externs are preserved with this patch. In the test case that I've added, for instance,
20:58:29 ~/3rd/llvm/test> opt -S -metarenamer Transforms/MetaRenamer/metarenamer.ll | tail -n 13 declare noalias i8* @malloc(i32) <================ declare void @free(i8* nocapture) <=============== define void @zot() { bb: %tmp = call i8* @malloc(i32 23) call void @free(i8* %tmp) ret void } attributes #0 = { nounwind ssp uwtable } attributes #1 = { argmemonly nounwind }
Am I missing your meaning?
I mean, all external functions, not just libcalls, e.g.
declare noalias i8* @blahgoo(i32) [...] call void @blahgoo(i8* %tmp)
... unless they're already preserved, in which case, feel free to ignore this comment.
What happens if there's a conflict between a meta-renamed function and originally named extern? For instance,
declare void @pluto() define void @dont_rename_lib_funcs(...) { ; metarenames to pluto. ... }
?
What I mean is that I don't see the reason for wanting to keep non-lib externs. Lib externs, on the other hand, need to stay un-renamed because some passes may behave differently in the presence of specific library functions. DSE, for instance, provides special handling for malloc-ed memory locations.
Actually, I think it would rename dont_rename_lib_funcs to pluto.1, pluto.2, etc. as it does now when it runs out of meta names (and if it doesn't, it should). What I really meant to ask is the reply above.
Add a comment explaining why you're skipping funcs.