[PATCH] D87953: [xray] Function coverage groups
kyulee added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:814 +auto FuncGroups = CGM.getCodeGenOpts().XRayTotalFunctionGroups; +if (FuncGroups > 1) { + auto FuncName = ArrayRef(CurFn->getName().bytes_begin(), MaskRay wrote: > For one group, the branch is skipped, which does not seem correct Should we check or assert `XRaySelectedFunctionGroups > 0` && `XRaySelectedFunctionGroup < XRaySelectedFunctionGroups` or the former at minimum? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87953/new/ https://reviews.llvm.org/D87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D87953: [xray] Function coverage groups
kyulee added a comment. I think it looks good to me. @MaskRay Any further feedback on this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87953/new/ https://reviews.llvm.org/D87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D114268: [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGde11de308b64: [InstrProf] Use i32 for GEP index from lowering llvm.instrprof.increment (authored by ellis, committed by kyulee). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114268/new/ https://reviews.llvm.org/D114268 Files: clang/test/CodeGen/profile-filter.c clang/test/Profile/branch-logical-mixed.cpp clang/test/Profile/c-captured.c clang/test/Profile/c-general.c clang/test/Profile/c-ternary.c clang/test/Profile/cxx-class.cpp clang/test/Profile/cxx-lambda.cpp clang/test/Profile/cxx-rangefor.cpp clang/test/Profile/cxx-stmt-initializers.cpp clang/test/Profile/cxx-templates.cpp clang/test/Profile/cxx-throws.cpp clang/test/Profile/objc-general.m llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll llvm/test/Transforms/PGOProfile/instr_entry_bb.ll Index: llvm/test/Transforms/PGOProfile/instr_entry_bb.ll === --- llvm/test/Transforms/PGOProfile/instr_entry_bb.ll +++ llvm/test/Transforms/PGOProfile/instr_entry_bb.ll @@ -18,7 +18,7 @@ ; GEN: entry: ; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0) ; GENA: entry: -; GENA: %{{[0-9+]}} = atomicrmw add i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i64 0, i64 0), i64 1 monotonic +; GENA: %{{[0-9+]}} = atomicrmw add i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i32 0, i32 0), i64 1 monotonic ; USE: br i1 %cmp, label %if.then, label %if.else ; USE-SAME: !prof ![[BW_ENTRY:[0-9]+]] ; USE: ![[BW_ENTRY]] = !{!"branch_weights", i32 0, i32 1} @@ -35,9 +35,9 @@ ; GEN: if.else: ; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_test_br_2, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1) ; GENA: if.else: -; GENA: %pgocount = load i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i64 0, i64 1), align 8 +; GENA: %pgocount = load i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i32 0, i32 1), align 8 ; GENA: [[V:%[0-9]*]] = add i64 %pgocount, 1 -; GENA: store i64 [[V]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i64 0, i64 1), align 8 +; GENA: store i64 [[V]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @__profc_test_br_2, i32 0, i32 1), align 8 %sub = sub nsw i32 %i, 2 br label %if.end Index: llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll === --- llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll +++ llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll @@ -38,11 +38,11 @@ for.body: ; preds = %for.cond ; CHECK: for.body: -; NOTENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 0) -; TENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 1) +; NOTENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i32 0, i32 0) +; TENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i32 0, i32 1) ; CHECK: %1 = add i64 %pgocount1, 1 -; NOTENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 0) -; ENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 1) +; NOTENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i32 0, i32 0) +; ENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i32 0, i32 1) %idxprom = zext i32 %i.0 to i64 %arrayidx = getelementptr inbounds [200 x i8], [200 x i8]* @"?buffer@@3PADA", i64 0, i64 %idxprom %0 = load i8, i8* %arrayidx, align 1 @@ -55,11 +55,11 @@ for.inc: ; preds = %if.end ; CHECK: for.inc: -; NOTENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 1) -; ENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i64 0, i64 2) +; NOTENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH@Z", i32 0, i32 1) +; ENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"_
[PATCH] D114565: [InstrProf] Attach debug info to counters
kyulee added inline comments. Comment at: compiler-rt/lib/profile/InstrProfilingWriter.c:273 - if (!DataSize) + if (!CountersSize) return 0; Is it no diff change? I wonder if there is a case where `CountersSize` is 0 but not `DataSize` from a value probe. If not, should we make a separate change? Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:647 + PD.NumValueSites[ValueKind] = + std::max(PD.NumValueSites[ValueKind], (uint32_t)(Index + 1)); } It appears this is a NFC. Should we make a separate change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114565/new/ https://reviews.llvm.org/D114565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D114565: [InstrProf] Attach debug info to counters
kyulee added inline comments. Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:851 + addString(AnnotationDie, dwarf::DW_AT_const_value, Value->getString()); +else if (const auto *Expr = dyn_cast(ValueOp)) + addConstantValue( It checks an expression but appears to apply the constant case below. Should it check a constant expression, instead? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114565/new/ https://reviews.llvm.org/D114565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D114565: [InstrProf] Attach debug info to counters
kyulee added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:961 + DB.finalize(); +} + } I think when `-debug-info-correlate` is used without debug info, we should fail or emit a warning here instead of silently proceeding it because we cannot correlate it anyhow down the road. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114565/new/ https://reviews.llvm.org/D114565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D114565: [InstrProf] Attach debug info to counters
kyulee added inline comments. Comment at: compiler-rt/lib/profile/InstrProfilingWriter.c:299 + if (DebugInfoCorrelate) { +ProfDataIOVec IOVecData[] = { Should it be down after `__llvm_write_binary_ids` below although it doesn't do anything in general? I saw D114566 seems to parse this to compute the other addresses. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114565/new/ https://reviews.llvm.org/D114565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D112119: [ObjC Availability] Add missing const to getVersion function of ObjCAvailabilityCheckExpr class
This revision was automatically updated to reflect the committed changes. Closed by commit rGf1c9e7bdc921: [ObjC Availability] Add missing const to getVersion function of… (authored by lcs, committed by kyulee). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112119/new/ https://reviews.llvm.org/D112119 Files: clang/include/clang/AST/ExprObjC.h Index: clang/include/clang/AST/ExprObjC.h === --- clang/include/clang/AST/ExprObjC.h +++ clang/include/clang/AST/ExprObjC.h @@ -1706,7 +1706,7 @@ /// This may be '*', in which case this should fold to true. bool hasVersion() const { return !VersionToCheck.empty(); } - VersionTuple getVersion() { return VersionToCheck; } + VersionTuple getVersion() const { return VersionToCheck; } child_range children() { return child_range(child_iterator(), child_iterator()); Index: clang/include/clang/AST/ExprObjC.h === --- clang/include/clang/AST/ExprObjC.h +++ clang/include/clang/AST/ExprObjC.h @@ -1706,7 +1706,7 @@ /// This may be '*', in which case this should fold to true. bool hasVersion() const { return !VersionToCheck.empty(); } - VersionTuple getVersion() { return VersionToCheck; } + VersionTuple getVersion() const { return VersionToCheck; } child_range children() { return child_range(child_iterator(), child_iterator()); ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D114565: [InstrProf] Attach debug info to counters
kyulee added a comment. This change for the profile writer looks good to me! Before signing it off, I'd like to hear any other suggestions or opinions from @davidxl @MaskRay @alanphipps since this is technically the very first change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114565/new/ https://reviews.llvm.org/D114565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D115979: [InstrProf] Don't profile merge by default in lightweight mode
kyulee added a comment. For clarification, the lightweight pgo does not support merging raw data from memory (at runtime) due to missing structural data, but it does support merging raw files offline. Would you update the comment or error message? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115979/new/ https://reviews.llvm.org/D115979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D107024: [DIBuilder] Do not replace empty enum types
This revision was automatically updated to reflect the committed changes. Closed by commit rG47b239eb5a17: [DIBuilder] Do not replace empty enum types (authored by ellis, committed by kyulee). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107024/new/ https://reviews.llvm.org/D107024 Files: clang/test/CodeGen/debug-info-codeview-heapallocsite.c clang/test/CodeGen/debug-info-macro.c clang/test/CodeGenCXX/debug-info-codeview-var-templates.cpp clang/test/CodeGenCXX/debug-info-cxx1y.cpp clang/test/CodeGenCXX/debug-info-template.cpp clang/test/CodeGenCXX/debug-info-var-template-partial-spec.cpp clang/test/CodeGenCoroutines/coro-dwarf.cpp llvm/lib/IR/DIBuilder.cpp llvm/test/CodeGen/AArch64/GlobalISel/constant-mir-debugify.mir llvm/test/CodeGen/AArch64/GlobalISel/phi-mir-debugify.mir llvm/test/DebugInfo/debugify.ll Index: llvm/test/DebugInfo/debugify.ll === --- llvm/test/DebugInfo/debugify.ll +++ llvm/test/DebugInfo/debugify.ll @@ -61,7 +61,7 @@ ; CHECK-DAG: !llvm.debugify = !{![[NUM_INSTS:.*]], ![[NUM_VARS:.*]]} ; CHECK-DAG: "Debug Info Version" -; CHECK-DAG: ![[CU]] = distinct !DICompileUnit(language: DW_LANG_C, file: {{.*}}, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: {{.*}}) +; CHECK-DAG: ![[CU]] = distinct !DICompileUnit(language: DW_LANG_C, file: {{.*}}, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug) ; CHECK-DAG: !DIFile(filename: "", directory: "/") ; CHECK-DAG: distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: {{.*}}, line: 1, type: {{.*}}, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: {{.*}}, retainedNodes: {{.*}}) ; CHECK-DAG: distinct !DISubprogram(name: "bar", linkageName: "bar", scope: null, file: {{.*}}, line: 2, type: {{.*}}, scopeLine: 2, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: {{.*}}, retainedNodes: {{.*}}) Index: llvm/test/CodeGen/AArch64/GlobalISel/phi-mir-debugify.mir === --- llvm/test/CodeGen/AArch64/GlobalISel/phi-mir-debugify.mir +++ llvm/test/CodeGen/AArch64/GlobalISel/phi-mir-debugify.mir @@ -38,39 +38,39 @@ ; CHECK: liveins: $w0 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0, debug-location !11 ; CHECK: DBG_VALUE [[COPY]](s32), $noreg, !9, !DIExpression(), debug-location !11 - ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 2, column: 1, scope: !6) - ; CHECK: DBG_VALUE [[C]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !6) - ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1, debug-location !DILocation(line: 3, column: 1, scope: !6) - ; CHECK: DBG_VALUE [[C1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !6) - ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 4, column: 1, scope: !6) - ; CHECK: DBG_VALUE [[C2]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !6) - ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]], debug-location !DILocation(line: 5, column: 1, scope: !6) - ; CHECK: DBG_VALUE [[ICMP]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !6) - ; CHECK: G_BRCOND [[ICMP]](s1), %bb.1, debug-location !DILocation(line: 6, column: 1, scope: !6) - ; CHECK: G_BR %bb.2, debug-location !DILocation(line: 7, column: 1, scope: !6) + ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0, debug-location !DILocation(line: 2, column: 1, scope: !5) + ; CHECK: DBG_VALUE [[C]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 2, column: 1, scope: !5) + ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1, debug-location !DILocation(line: 3, column: 1, scope: !5) + ; CHECK: DBG_VALUE [[C1]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 3, column: 1, scope: !5) + ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2, debug-location !DILocation(line: 4, column: 1, scope: !5) + ; CHECK: DBG_VALUE [[C2]](s32), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 4, column: 1, scope: !5) + ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[COPY]](s32), [[C]], debug-location !DILocation(line: 5, column: 1, scope: !5) + ; CHECK: DBG_VALUE [[ICMP]](s1), $noreg, !9, !DIExpression(), debug-location !DILocation(line: 5, column: 1, scope: !5) + ; CHECK: G_BRCOND [[ICMP]](s1), %bb.1, debug-location !DILocation(line: 6, column: 1, scope: !5) + ; CHECK: G_BR %bb.2, debug-location !DILocation(line: 7, column: 1, scope: !5) ; CHECK: bb.1: ; CHECK: successors: %bb.3(0x8000) - ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C1]], debug-location !DILocation(line: 8, column: 1, s