From a99980771670fd733d795403de8ed43ce3bc7791 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 27 Jan 2015 22:57:35 +0000 Subject: [PATCH] SymbolRewriter: prevent unnecessary rewrite The rewrite for the pattern based rewrite is unnecessary if the existing name matches the pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227260 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SymbolRewriter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Transforms/Utils/SymbolRewriter.cpp b/lib/Transforms/Utils/SymbolRewriter.cpp index b35a662f17b..c93cdc4b52e 100644 --- a/lib/Transforms/Utils/SymbolRewriter.cpp +++ b/lib/Transforms/Utils/SymbolRewriter.cpp @@ -145,6 +145,9 @@ performOnModule(Module &M) { report_fatal_error("unable to transforn " + C.getName() + " in " + M.getModuleIdentifier() + ": " + Error); + if (C.getName() == Name) + continue; + if (Value *V = (M.*Get)(Name)) C.setValueName(V->getValueName()); else -- 2.34.1