[PATCH] D157750: Properly handle -fsplit-machine-functions for fatbinary compilation

2023-08-11 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a subscriber: dhoekwater. snehasish added inline comments. Comment at: llvm/lib/CodeGen/TargetPassConfig.cpp:1278 } -addPass(createMachineFunctionSplitterPass()); +if (TM->getTargetTriple().isX86()) +

[PATCH] D154856: [MemProf] Use new option/pass for profile feedback and matching

2023-07-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. This revision is now accepted and ready to land. lgtm, thanks for testing the various combinations of profiles passed to each option. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D154856: [MemProf] Use new option/pass for profile feedback and matching

2023-07-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/MemProfiler.cpp:912 +const TargetLibraryInfo = FAM.getResult(F); +readMemprof(M, F, MemProfReader.get(), TLI); + } I think we can we split this patch into two to make the

[PATCH] D151593: [MemProf] Clean up MemProf instrumentation pass invocation

2023-05-26 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. lgtm Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151593/new/ https://reviews.llvm.org/D151593 ___ cfe-commits mailing list

[PATCH] D149215: [MemProf] Control availability of hot/cold operator new from LTO link

2023-05-02 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. This revision is now accepted and ready to land. lgtm Comment at: llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp:3163 + // TODO: If/when other types of memprof cloning are enabled beyond just for + //

[PATCH] D149600: [MemProf] Recognize hot/cold operator new as replaceable allocations

2023-05-01 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. This revision is now accepted and ready to land. lgtm Comment at: clang/test/CodeGenCXX/new_hot_cold.cpp:16 + +enum class __hot_cold_t : uint8_t; +namespace malloc_namespace { Can we skip the typedef

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-14 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa1bbf5ac3cbd: [memprof] Record BuildIDs in the raw profile. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145190/new/

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-13 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 504887. snehasish added a comment. Update the unittest in compiler-rt which was caught by the build bot failures. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145190/new/ https://reviews.llvm.org/D145190

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-13 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish reopened this revision. snehasish added a comment. This revision is now accepted and ready to land. Reopening since I missed the updates to the memprof unit tests in compiler-rt. This was caught by the buildbots. As part of the changes I modified the `SerializeToRawProfile` API

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-13 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG287177a47a39: [memprof] Record BuildIDs in the raw profile. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145190/new/

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 503945. snehasish added a comment. Update test regex. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145190/new/ https://reviews.llvm.org/D145190 Files: clang/test/CodeGen/Inputs/memprof.exe

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. In D145190#4181789 , @snehasish wrote: > In D145190#4181608 , @tejohnson > wrote: > >> lgtm - but does this depend on D145644 >> and require some

[PATCH] D145190: [memprof] Record BuildIDs in the raw profile.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 503938. snehasish added a comment. Herald added subscribers: cfe-commits, wenlei. Herald added a project: clang. Update raw profiles, add another test for buildids only. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe99b5ad38381: [memprof] Add scripts to automate testdata regeneration. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. I'll go ahead and push this. @dblaikie Let me know if you have any comments and I'll follow up separately. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145644/new/ https://reviews.llvm.org/D145644

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked an inline comment as done. snehasish added a comment. In D145644#4182239 , @tejohnson wrote: > Generally lgtm, but why did the raw profiles change size from what is > currently committed? The reduction in size of the raw profiles is

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 503859. snehasish added a comment. Update the script in test/tool/llvm-profdata/Inputs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145644/new/ https://reviews.llvm.org/D145644 Files:

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/test/Transforms/PGOProfile/Inputs/update_memprof_inputs.sh:63 + delete[] f; + + // Loop ensures the two calls to recurse have stack contexts that only differ @tejohnson Turns out the LLVM IR matching issue was

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 503850. snehasish added a comment. Update the script for Transforms/PGOProfile/memprof.ll. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145644/new/ https://reviews.llvm.org/D145644 Files:

[PATCH] D145644: [memprof] Add scripts to automate testdata regeneration.

2023-03-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish created this revision. snehasish added reviewers: tejohnson, dblaikie. Herald added a subscriber: wenlei. Herald added a project: All. snehasish requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. The memprof

[PATCH] D141558: [MemProf] Collect access density statistics during profiling

2023-01-12 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish 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/D141558/new/ https://reviews.llvm.org/D141558

[PATCH] D141558: [MemProf] Collect access density statistics during profiling

2023-01-12 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. Thanks for updating the tests. Comment at: llvm/include/llvm/ProfileData/MemProfData.inc:35 // The version number of the raw binary format. #define MEMPROF_RAW_VERSION 1ULL Can you increment the version here? Then we won't

[PATCH] D128142: [MemProf] Memprof profile matching and annotation

2022-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. This revision is now accepted and ready to land. lgtm Comment at: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1276 + if (Error E = MemProfResult.takeError()) { +handleAllErrors(std::move(E),

[PATCH] D128142: [MemProf] Memprof profile matching and annotation

2022-07-25 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Herald added a subscriber: mingmingl. Comment at: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1249 +void addCallStack(CallStackTrie , const AllocationInfo *AllocInfo) { + auto AllocType =

[PATCH] D128142: [MemProf] Memprof profile matching and annotation

2022-06-22 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. I'm still going through PGOInstrumentation.cpp ... Comment at: clang/test/CodeGen/memprof.cpp:15 +// # Collect memory profile: +// $ clang++ -fuse-ld=lld -Wl,-no-pie -Wl,--no-rosegment -gmlt \ +// -fdebug-info-for-profiling

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2022-01-31 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/include/llvm/ProfileData/InstrProfReader.h:495 + InstrProfKind getProfileKind() const override { +InstrProfKind ProfileKind = InstrProfKind::Unknown; mtrofin wrote: > This looks a lot like line 290, can it

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2022-01-27 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG13d89477be56: [InstrProf][NFC] Refactor Profile kind into a bitset enum. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2022-01-27 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 403746. snehasish added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115393/new/ https://reviews.llvm.org/D115393 Files: llvm/include/llvm/ProfileData/InstrProf.h

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2022-01-27 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/include/llvm/ProfileData/InstrProf.h:281-282 +/// An enum describing the attributes of an instrumented profile. +enum class InstrProfKind { + Unknown = 0x0, ellis wrote: > I've been working on a new coverage

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2022-01-06 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 398018. snehasish added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115393/new/ https://reviews.llvm.org/D115393 Files: llvm/include/llvm/ProfileData/InstrProf.h

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-15 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. Herald added a subscriber: ellis. ping @xur Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115393/new/ https://reviews.llvm.org/D115393 ___ cfe-commits mailing list

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. @xur Could you please take a look with a focus on ensuring that this change retains the semantics that you expect? Previously there were different enum values which indicated CS+IR vs IR only. Now the IR bit is set for both cases (to be consistent with the version

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/include/llvm/ProfileData/InstrProfReader.h:93 - virtual bool isIRLevelProfile() const = 0; - tejohnson wrote: > It seems like these helper methods could still be defined using the new > bitset, which would

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 392938. snehasish added a comment. Remove extra line in PGOInstrumentation.cpp. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115393/new/ https://reviews.llvm.org/D115393 Files:

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 392937. snehasish added a comment. Reintroduce the helpers while keeping the bitset. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115393/new/ https://reviews.llvm.org/D115393 Files:

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 392927. snehasish added a comment. Cleanup for review - - Added some more descriptive comments. - Removed a couple of unintentional blank lines. - Removed a couple of commented lines of code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D115393: [InstrProf][NFC] Refactor Profile kind into a bitset enum.

2021-12-08 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish created this revision. snehasish added reviewers: xur, davidxl. Herald added subscribers: wenlei, hiraditya. snehasish requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. This change refactors the ProfileKind enum

[PATCH] D87943: [clang] Remove profile available check for fsplit-machine-functions.

2020-09-18 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb86f1af42395: [clang] Remove profile available check for fsplit-machine-functions. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87943: [clang] Remove profile availabile check for fsplit-machine-functions.

2020-09-18 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 2 inline comments as done. snehasish added a comment. Thanks for the quick review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87943/new/ https://reviews.llvm.org/D87943 ___

[PATCH] D87943: [clang] Remove profile availabile check for fsplit-machine-functions.

2020-09-18 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 292899. snehasish added a comment. Drop braces, add a test. - Remove braces from single line if. - Add a test to make sure that option is passed through even if no profiles provided. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87943: [clang] Remove profile availabile check for fsplit-machine-functions.

2020-09-18 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish created this revision. snehasish added reviewers: tejohnson, davidxl. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. snehasish requested review of this revision. Enforcing a profile available check in the driver does not work with incremental LTO

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-15 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf1a3ab904439: [clang] Add a command line flag for the Machine Function Splitter. (authored by snehasish). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-15 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. Thanks for the review. Comment at: clang/include/clang/Driver/Options.td:2000 +defm split_machine_functions: OptInFFlag<"split-machine-functions", + "Enable", "Disable", " late function splitting using profile information (x86-elf only)">; +

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-15 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291986. snehasish marked 2 inline comments as done. snehasish added a comment. Update the test. - Added "warning: " prefix to be checked. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87047/new/

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291775. snehasish added a comment. Remove unnecessary includes, update doc text. - Update doctext. - Remove no longer necessary includes to frontend driver diagnostics. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 3 inline comments as done. snehasish added a comment. That makes sense. I moved the check to lib/Driver/ToolChains/Clang.cpp and updated the test. Seems cleaner to have all the checks in one place. PTAL, thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291771. snehasish marked an inline comment as done. snehasish added a comment. Check profile flag in Driver, update test. - Move the profile missing warning check to the Driver. - Update the test to use -### for CHECK-WARN. Repository: rG LLVM Github

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked an inline comment as done. snehasish added inline comments. Comment at: clang/test/Driver/fsplit-machine-functions.c:3 +// RUN: %clang -### -target x86_64 -fprofile-use=default.profdata -fsplit-machine-functions -fno-split-machine-functions %s -c 2>&1 |

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291758. snehasish added a comment. Remove extra -c from test command line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87047/new/ https://reviews.llvm.org/D87047 Files:

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. @MaskRay ping, let me know if you have any further comments. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87047/new/ https://reviews.llvm.org/D87047 ___ cfe-commits

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-14 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291728. snehasish added a comment. Rebased patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87047/new/ https://reviews.llvm.org/D87047 Files: clang/include/clang/Basic/CodeGenOptions.def

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-11 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 3 inline comments as done. snehasish added a subscriber: dblaikie. snehasish added a comment. > It feels wrong that the assembly+llvm-profdata test is in clang/test I agree with @dblaikie and your assessment that it feels wrong to add such a test to clang. In the first version

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-11 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291292. snehasish added a comment. Remove clang/CodeGen test, update arg render logic. - Removed the clang/CodeGen test. - Added a check for the option to be rendered. - Fixed extra flags in driver test. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked an inline comment as done. snehasish added inline comments. Comment at: clang/test/CodeGen/split-machine-functions.c:3 + +// RUN: echo "foo"> %t.proftext +// RUN: echo "# Func Hash:" >> %t.proftext snehasish wrote: >

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291122. snehasish marked an inline comment as done. snehasish added a comment. Fix test formatting. Added clang-format off to disable clang format for the test which contains both profile data (as text) and c code. Repository: rG LLVM Github Monorepo

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 3 inline comments as done. snehasish added a comment. PTAL, thanks! Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4259 options::OPT_fno_unique_basic_block_section_names, +options::OPT_fsplit_machine_functions, +

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291108. snehasish added a comment. Use OptInFFlag, split-file and update tests. - Change the flag type to OptInFFlag. - Use split-file in the test to avoid "RUN: echo" lines. - Use an existing warn message (if no profile is available) and add a check for

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291063. snehasish added a comment. Check warning, specify target to avoid failures on windows. - Added a check for warning emitted if no profile is provided. - Added a triple for the remaining checks since we now emit an error for incompatible targets.

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 291051. snehasish added a comment. Updated test and warning type. - Updated test to check for the diagnostic message. - Updated BackendUtil.cpp to use backend optimization failure warning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG157cd93b48a9: [clang] Disallow fbasic-block-sections on non-ELF, non-x86 targets. (authored by snehasish). Repository: rG LLVM Github Monorepo

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 4 inline comments as done. snehasish added a comment. Thanks for explaining the rationale, PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87426/new/ https://reviews.llvm.org/D87426

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-10 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 290884. snehasish marked an inline comment as done. snehasish added a comment. Update test to use `not` tool and `-c` flag. - Use the not tool to indicate failure is expected. - Use -c instead of -### for failing invocations. Repository: rG LLVM Github

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish marked 3 inline comments as done. snehasish added a comment. Thanks for the quick review @MaskRay, PTAL. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4892 +} else { + D.Diag(diag::warn_drv_unsupported_opt_for_target) + << A->getAsString(Args)

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 290867. snehasish added a comment. Update test based on review comments. - Use diag::err instead of warn. - Drop linux-gnu from the triple for the default test. - Check for the presence of the diagnostic message. Repository: rG LLVM Github Monorepo

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 290863. snehasish added a comment. Specify triple for driver tests, address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87426/new/ https://reviews.llvm.org/D87426 Files:

[PATCH] D87426: Disallow fbasic-block-sections on non-ELF, non-x86 targets.

2020-09-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish created this revision. snehasish added reviewers: tmsriram, rahmanl. Herald added a project: clang. Herald added a subscriber: cfe-commits. snehasish requested review of this revision. Basic block sections is untested on other platforms and binary formats apart from x86,elf. This patch

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-09 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 290852. snehasish added a comment. Add a check for x86-elf. - Add a check for the triple in the driver to only enable the flag on x86+elf targets. - Add a test to ensure we don't enable this on other targets. Repository: rG LLVM Github Monorepo

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-03 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added a comment. Thanks for the comments! PTAL. In D87047#2252982 , @davidxl wrote: > For x86 target, should it be turned on when -fprofile-use= option is > specified unless -fno-split-machine-function is specified? I don't think we are there

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-03 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish updated this revision to Diff 289805. snehasish added a comment. Add warning when option is enabled without profile. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87047/new/ https://reviews.llvm.org/D87047 Files:

[PATCH] D87047: [clang] Add command line options for the Machine Function Splitter.

2020-09-02 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish created this revision. snehasish added reviewers: tmsriram, davidxl. Herald added subscribers: cfe-commits, dang. Herald added a project: clang. snehasish requested review of this revision. This patch adds a command line flag for the machine function splitter (added in rG94faadaca4e1

[PATCH] D85408: Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols.

2020-08-28 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish accepted this revision. snehasish added a comment. This revision is now accepted and ready to land. LGTM. Please wait a bit for additional comments from others. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85408/new/

[PATCH] D85408: Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols.

2020-08-26 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1030 +/// recursive return edges vs. indirect branches. The format of the metadata is +/// described as follows: 1st bit (LSB): set if this is a return block (return +/// or tail call). 2nd

[PATCH] D85408: Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols.

2020-08-26 Thread Snehasish Kumar via Phabricator via cfe-commits
snehasish added inline comments. Comment at: clang/docs/UsersManual.rst:1706 + its own unique section. With the "labels" value, normal sections are emitted, + but a ".bb_addr_map" section is emitted which would include address offsets + for each basic block in the program,