diff options
-rw-r--r-- | llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 6 | ||||
-rw-r--r-- | llvm/test/ThinLTO/X86/cfi-devirt.ll | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp index d65da2504db..2f75c6b6614 100644 --- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -755,7 +755,8 @@ void DevirtModule::applySingleImplDevirt(VTableSlotInfo &SlotInfo, auto Apply = [&](CallSiteInfo &CSInfo) { for (auto &&VCallSite : CSInfo.CallSites) { if (RemarksEnabled) - VCallSite.emitRemark("single-impl", TheFn->getName(), OREGetter); + VCallSite.emitRemark("single-impl", + TheFn->stripPointerCasts()->getName(), OREGetter); VCallSite.CS.setCalledFunction(ConstantExpr::getBitCast( TheFn, VCallSite.CS.getCalledValue()->getType())); // This use is no longer unsafe. @@ -891,7 +892,8 @@ void DevirtModule::applyICallBranchFunnel(VTableSlotInfo &SlotInfo, continue; if (RemarksEnabled) - VCallSite.emitRemark("branch-funnel", JT->getName(), OREGetter); + VCallSite.emitRemark("branch-funnel", + JT->stripPointerCasts()->getName(), OREGetter); // Pass the address of the vtable in the nest register, which is r10 on // x86_64. diff --git a/llvm/test/ThinLTO/X86/cfi-devirt.ll b/llvm/test/ThinLTO/X86/cfi-devirt.ll index 40aeef1a0c1..e41ae6d15ec 100644 --- a/llvm/test/ThinLTO/X86/cfi-devirt.ll +++ b/llvm/test/ThinLTO/X86/cfi-devirt.ll @@ -5,7 +5,7 @@ ; RUN: opt -thinlto-bc -o %t.o %s ; Legacy PM -; RUN: llvm-lto2 run %t.o -save-temps \ +; RUN: llvm-lto2 run %t.o -save-temps -pass-remarks=. \ ; RUN: -o %t3 \ ; RUN: -r=%t.o,test,px \ ; RUN: -r=%t.o,_ZN1A1nEi,p \ @@ -17,11 +17,11 @@ ; RUN: -r=%t.o,_ZN1B1fEi, \ ; RUN: -r=%t.o,_ZN1C1fEi, \ ; RUN: -r=%t.o,_ZTV1B,px \ -; RUN: -r=%t.o,_ZTV1C,px +; RUN: -r=%t.o,_ZTV1C,px 2>&1 | FileCheck %s --check-prefix=REMARK ; RUN: llvm-dis %t3.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-IR ; New PM -; RUN: llvm-lto2 run %t.o -save-temps -use-new-pm \ +; RUN: llvm-lto2 run %t.o -save-temps -use-new-pm -pass-remarks=. \ ; RUN: -o %t3 \ ; RUN: -r=%t.o,test,px \ ; RUN: -r=%t.o,_ZN1A1nEi,p \ @@ -33,9 +33,11 @@ ; RUN: -r=%t.o,_ZN1B1fEi, \ ; RUN: -r=%t.o,_ZN1C1fEi, \ ; RUN: -r=%t.o,_ZTV1B,px \ -; RUN: -r=%t.o,_ZTV1C,px +; RUN: -r=%t.o,_ZTV1C,px 2>&1 | FileCheck %s --check-prefix=REMARK ; RUN: llvm-dis %t3.1.4.opt.bc -o - | FileCheck %s --check-prefix=CHECK-IR +; REMARK: single-impl: devirtualized a call to _ZN1A1nEi + target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-grtev4-linux-gnu" |