[PATCH] D71485: [profile] Fix a crash when -fprofile-remapping-file= triggers an error
This revision was automatically updated to reflect the committed changes. Closed by commit rG193da743db63: [profile] Fix a crash when -fprofile-remapping-file= triggers an error (authored by MaskRay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71485/new/ https://reviews.llvm.org/D71485 Files: clang/test/CodeGenCXX/Inputs/profile-remap-error.map clang/test/CodeGenCXX/profile-remap-error.cpp llvm/lib/Transforms/IPO/SampleProfile.cpp Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,7 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,7 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D71485: [profile] Fix a crash when -fprofile-remapping-file= triggers an error
MaskRay updated this revision to Diff 233843. MaskRay added a comment. Delete unused declaration Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71485/new/ https://reviews.llvm.org/D71485 Files: clang/test/CodeGenCXX/Inputs/profile-remap-error.map clang/test/CodeGenCXX/profile-remap-error.cpp llvm/lib/Transforms/IPO/SampleProfile.cpp Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,7 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,7 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D71485: [profile] Fix a crash when -fprofile-remapping-file= triggers an error
wmi accepted this revision. wmi added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71485/new/ https://reviews.llvm.org/D71485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D71485: [profile] Fix a crash when -fprofile-remapping-file= triggers an error
MaskRay created this revision. MaskRay added reviewers: rsmith, wenlei, wmi. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D71485 Files: clang/test/CodeGenCXX/Inputs/profile-remap-error.map clang/test/CodeGenCXX/profile-remap-error.cpp llvm/lib/Transforms/IPO/SampleProfile.cpp Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,9 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data + +void foo(); Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored Index: llvm/lib/Transforms/IPO/SampleProfile.cpp === --- llvm/lib/Transforms/IPO/SampleProfile.cpp +++ llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1973,7 +1973,8 @@ : ProfileRemappingFileName, IsThinLTOPreLink, GetAssumptionCache, GetTTI); - SampleLoader.doInitialization(M); + if (!SampleLoader.doInitialization(M)) +return PreservedAnalyses::all(); ProfileSummaryInfo *PSI = (M); CallGraph = AM.getResult(M); Index: clang/test/CodeGenCXX/profile-remap-error.cpp === --- /dev/null +++ clang/test/CodeGenCXX/profile-remap-error.cpp @@ -0,0 +1,9 @@ +// REQUIRES: x86-registered-target + +// RUN: not %clang_cc1 -triple x86_64-linux-gnu -fprofile-sample-use=%S/Inputs/profile-remap.samples -fprofile-remapping-file=%S/Inputs/profile-remap-error.map -fexperimental-new-pass-manager -O2 %s -emit-llvm -o - 2>&1 | FileCheck %s + +// CHECK: error: {{.*}}/profile-remap-error.map:1: Could not demangle 'unmangled' as a ; invalid mangling? +// CHECK-NEXT: error: {{.*}}/profile-remap-error.map: Could not create remapper: Malformed sample profile data +// CHECK-NEXT: error: {{.*}}/profile-remap.samples: Could not open profile: Malformed sample profile data + +void foo(); Index: clang/test/CodeGenCXX/Inputs/profile-remap-error.map === --- /dev/null +++ clang/test/CodeGenCXX/Inputs/profile-remap-error.map @@ -0,0 +1 @@ +name unmangled ignored ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits