[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-05-19 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 265046. zequanwu added a comment. Update test cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://reviews.llvm.org/D80153 Files: clang/lib/AST/MicrosoftMangle.cpp clang/test/CodeGenCXX/mangle-ms-cxx11.cpp clang/test/CodeG

[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-05-19 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 265031. zequanwu added a comment. Remove check for context of `LambdaContextDecl`. Update test cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://reviews.llvm.org/D80153 Files: clang/lib/AST/MicrosoftMangle.cpp Index: clan

[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-05-20 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 265388. zequanwu edited the summary of this revision. zequanwu added a comment. Check `LambdaContextDecl` is not `ParamVarDecl`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://reviews.llvm.org/D80153 Files: clang/lib/AST/Micros

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-05-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:1590-1600 +// flush all const reference uses diags +for (const auto &P : constRefUses) { + const VarDecl *vd = P.first; + const MappedType &V = P.second; + + UsesVec *vec =

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-05-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 265605. zequanwu marked 2 inline comments as done. zequanwu added a comment. rename parameter `uses` to `um` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79895/new/ https://reviews.llvm.org/D79895 Files: clang/include/clang/Analysis/Analyses/Un

[PATCH] D80409: [MS ABI] Add mangled type for template integer argument

2020-05-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added a reviewer: thakis. zequanwu added a project: clang. Herald added a subscriber: cfe-commits. To differentiate different types of template integer arguments, as MSVC does. Bug filed here: https://bugs.llvm.org/show_bug.cgi?id=45969 which is caused by

[PATCH] D79121: Add nomerge statement attribute to clang

2020-05-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 265648. zequanwu retitled this revision from "Add nomerge function attribute to clang" to "Add nomerge statement attribute to clang". zequanwu edited the summary of this revision. zequanwu added a comment. update test case. CHANGES SINCE LAST ACTION http

[PATCH] D79121: Add nomerge statement attribute to clang

2020-05-25 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu closed this revision. zequanwu added a comment. landed CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79121/new/ https://reviews.llvm.org/D79121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral

2020-05-25 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 266082. zequanwu retitled this revision from "[MS ABI] Add mangled type for template integer argument" to "[MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral ". zequanwu edited the summary of this revision. zequanwu added

[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral

2020-05-26 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/test/CodeGenCXX/mangle-ms-auto-templates.cpp:17 + AutoParmTemplate<0> auto_int; + // CHECK: call {{.*}} @"??0?$AutoParmTemplate@$H0A@@@QAE@XZ" + AutoParmTemplate auto_bool; ---

[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral

2020-05-26 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/test/CodeGenCXX/mangle-ms-auto-templates.cpp:17 + AutoParmTemplate<0> auto_int; + // CHECK: call {{.*}} @"??0?$AutoParmTemplate@$H0A@@@QAE@XZ" + AutoParmTemplate auto_bool; ---

[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral

2020-05-26 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 266339. zequanwu added a comment. Add `19.20` version. Only add mangled type for version 19. 20 or later to be abi-compatible with https://godbolt.org/z/Bhc__A CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80409/new/ https://reviews.llvm.org/D8040

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-05-26 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. @rsmith Are you okay with this patch? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79895/new/ https://reviews.llvm.org/D79895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-05-28 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 267057. zequanwu added a comment. Don't mangle `ParmVarDecl`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://reviews.llvm.org/D80153 Files: clang/lib/AST/MicrosoftMangle.cpp clang/test/CodeGenCXX/mangle-ms-cxx17.cpp Index:

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-06-02 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 267922. zequanwu added a comment. Rebase and address comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79895/new/ https://reviews.llvm.org/D79895 Files: clang/include/clang/Analysis/Analyses/UninitializedValues.h clang/include/clang/Basi

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-06-02 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG170b6869b563: [Clang] Add a new warning to warn when passing uninitialized variables as const… (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-06-02 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/lib/Analysis/UninitializedValues.cpp:676 + Value v = vals[vd]; + if (isUninitialized(v)) +handler.handleConstRefUseOfUninitVariable(vd, getUninitUse(ex, vd, v)); Ma

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-16 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2151773 , @zequanwu wrote: > In D83592#2151217 , @vsk wrote: > > > Could you add an end-to-end llvm-cov test (see e.g. > > compiler-rt/test/profile/Linux/coverage_ctors.cpp)? Her

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-16 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2157130 , @vsk wrote: > > ! In D83592#2156758 , @zequanwu > > wrote: > > One way I could think is probably when we visit decl in > > `CounterCoverageMappingBuilder`, check for

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-20 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279329. zequanwu added a comment. Herald added a project: Sanitizers. Herald added a subscriber: Sanitizers. Rebase and address comments. - Keep track of token locations before and after comment regions by `onToken` in `Preprocessor` so when emitting `Skipp

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-20 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279331. zequanwu added a comment. `arc diff --update` automatically formatted test case. Reverted. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/include/clang/Lex/Preprocessor.h clang/lib

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-20 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279394. zequanwu marked 7 inline comments as done. zequanwu added a comment. Address comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/Cod

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-20 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279395. zequanwu added a comment. Missed something. Updated CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/CodeGen/CodeGenAction.cpp clang/lib/

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279595. zequanwu marked 2 inline comments as done. zequanwu retitled this revision from "[Parser] Add comment to skipped regions" to "[Coverage] Add comment to skipped regions". zequanwu edited the summary of this revision. zequanwu added a comment. - Addres

[PATCH] D84225: [CFE] Add nomerge function attribute to inline assembly.

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu accepted this revision. zequanwu 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/D84225/new/ https://reviews.llvm.org/D84225 __

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279605. zequanwu added a comment. Change `@LINE` to `# @LINE`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/CodeGen/CodeGenAction.cpp clang/l

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 279661. zequanwu added a comment. remove unnecessary header. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/CodeGen/CodeGenAction.cpp clang/lib

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu closed this revision. zequanwu added a comment. Landed here, https://reviews.llvm.org/rGabd45154bdb6b76c5b480455eacc8c75b08242aa I put the wrong diff ID.. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 ___

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: compiler-rt/test/profile/coverage_comments.cpp:9 +int y = 0; /* comment */ // CHECK: [[# @LINE]]| 1| int y = 0; /* comment */ +int z = 0; // comment // CHECK:

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-21 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2165818 , @thakis wrote: > Looks like this breaks tests on Windows: > http://45.33.8.238/win/20315/step_7.txt > > Please take a look, and if it takes a while to investigate please revert > while you look. Fixed CHA

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2167926 , @vsk wrote: > @zequanwu I'm not sure whether this is something you've already tried, but > for frontend changes, it can be helpful to verify that a stage2 clang > self-host with assertions enabled completes

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. I found the problem is that I was trying to merge two skipped regions when they are adjacent. So, the following code will fail at assertion, because the skipped regions are in different files, but are merged. $ cat a.h // comment $ cat a.c #include "a.h" // c

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 280005. zequanwu added a comment. Fix the bug about merging skipped regions. Simple don't merge, because `adjustSkippedRange` will handle those cases if `NextTokLoc` is invalid, which will just skip the next if condition. CHANGES SINCE LAST ACTION https

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. Just tried the cmake option `-DLLVM_BUILD_INSTRUMENTED_COVERAGE=On`, the result still shows count for comments... but it pass the `coverage_comments.cpp` test case, need more investigation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://revi

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-23 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 280283. zequanwu edited the summary of this revision. zequanwu added a comment. In `Preprocessor.cpp`, don't increment `TokenCount` if `LexLevel == 0`. I tests this with chromium crypto_unittests. It doesn't track comments regions. I don't why when using th

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-23 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/lib/Lex/Preprocessor.cpp:973 + if ((LexLevel == 0 || PreprocessToken) && + !Result.getFlag(Token::IsReinjected)) { +if (LexLevel == 0) @hans , can you take a lo

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/lib/Lex/Preprocessor.cpp:973 + if ((LexLevel == 0 || PreprocessToken) && + !Result.getFlag(Token::IsReinjected)) { +if (LexLevel == 0) hans wrote: > zequanwu wr

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 280504. zequanwu added a comment. Change `newSR.ColumnEnd = 1` to `newSR.ColumnEnd = SR.ColumnStart + 1` to ensure ColumnEnd >= ColumnStart. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/i

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-26 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2174600 , @vsk wrote: > In D83592#2170912 , @zequanwu wrote: > > > I don't why when using the cmake option > > `-DLLVM_BUILD_INSTRUMENTED_COVERAGE=On` to test coverage for clang

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-27 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. @vsk Do you think it's ok to reland this commit? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D83592: [Coverage] Add comment to skipped regions

2020-07-28 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb46176bbb094: Reland [Coverage] Add comment to skipped regions (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://revi

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-06-04 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D79895#2073698 , @sylvestre.ledru wrote: > @zequanwu could you please update the release notes? thanks > https://github.com/llvm/llvm-project/blob/master/clang/docs/ReleaseNotes.rst Done. Repository: rG LLVM Github Mono

[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral

2020-06-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. Do you think adding `MSVC2019` to make the name mangling compatible with `MSVC v19.20` is acceptable? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80409/new/ https://reviews.llvm.org/D80409 ___ cfe-commits mailin

[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-06-10 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 269882. zequanwu added a comment. rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://reviews.llvm.org/D80153 Files: clang/lib/AST/MicrosoftMangle.cpp clang/test/CodeGenCXX/mangle-ms-cxx17.cpp Index: clang/test/CodeGenCXX

[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

2020-06-10 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe408cba84f8a: [AST] Mangle LambdaContextDecl for top level decl (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80153/new/ https://rev

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-02 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 275160. zequanwu marked 7 inline comments as done. zequanwu added a comment. Herald added a project: clang. Herald added a subscriber: cfe-commits. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-02 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 275161. zequanwu added a comment. update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https://reviews.llvm.org/D83013 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm/InitializePass

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-05 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 275558. zequanwu added a comment. Enable CGProfilePass for opt with LPM by default, like opt with NPM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https://reviews.llvm.org/D83013 Files: clang/l

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-07-05 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: clang/lib/Analysis/UninitializedValues.cpp:435 if ((*I)->getType().isConstQualified()) -classify((*I), ConstRefUse); +if (!hasTrivialBody(CE)) + classify((*I), C

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-06 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 275763. zequanwu added a comment. Delete `enable-npm-call-graph-profile` option for NPM, using `enable-call-graph-profile` for both LPM and NPM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https:

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-07-06 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG054704082b46: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty… (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-07-07 Thread Zequan Wu via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG054704082b46: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty… (authored by zequanwu). Repositor

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-07 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: llvm/test/Other/opt-O2-pipeline.ll:289 +; CHECK-NEXT: Branch Probability Analysis +; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: FunctionPass Manager ---

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-07 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: llvm/test/Other/opt-O2-pipeline.ll:289 +; CHECK-NEXT: Branch Probability Analysis +; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: FunctionPass Manager ---

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-07 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Comment at: llvm/test/Other/opt-O2-pipeline.ll:289 +; CHECK-NEXT: Branch Probability Analysis +; CHECK-NEXT: Block Frequency Analysis ; CHECK-NEXT: FunctionPass Manager MaskRay wrote: > zequanwu wrote: > > zequ

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-07 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276208. zequanwu marked an inline comment as done. zequanwu added a comment. Herald added subscribers: dexonsmith, steven_wu. - Disable `enable-call-graph-profile` by default in opt. - Disable `CGProfilePass` by default in clang unless `-no-integrated-as` is

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-08 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276526. zequanwu added a comment. - Remove "enable-call-graph-profile" option and enable CGProfilePass by default, unless `-no-integrated-as` is given in clang. - Use `LazyBlockFrequencyInfoPass` instead of `BlockFrequencyInfoWrapperPass` and check `F.getEn

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-08 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added a comment. > The alternative of using LazyBlockFrequencyInfoPass and checking > PSI->hasProfileSummary() first would also work I guess. If you think that's > cleaner, maybe that's the better way to go. Since `PSI->hasProfileSummary()` is

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276808. zequanwu added a comment. Update test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https://reviews.llvm.org/D83013 Files: clang/include/clang/Basic/CodeGenOptions.def clang/lib/C

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276813. zequanwu added a comment. rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https://reviews.llvm.org/D83013 Files: clang/include/clang/Basic/CodeGenOptions.def clang/lib/CodeGen/Bac

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rGc92a8c0a0f68: [LPM] Port CGProfilePass from NPM to LPM (authored by zequanwu). Repository: rG LLVM Github Monorepo CHA

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276834. zequanwu added a comment. Add comments and fix test failure in http://45.33.8.238/linux/22500/step_7.txt. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83013/new/ https://reviews.llvm.org/D83013 Files

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked 5 inline comments as done. zequanwu added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/CGProfile.cpp:64 // Ignore error here. Indirect calls are ignored if this fails. - (void)(bool)Symtab.create(M); + (void)(bool) Symtab.create(M); fo

[PATCH] D83514: [Lexer] Fix missing coverage line after #endif

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added reviewers: vsk, efriedma, arphaman. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. bug reported here: https://bugs.llvm.org/show_bug.cgi?id=46660 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D835

[PATCH] D83514: [Lexer] Fix missing coverage line after #endif

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG672ae621e91f: [Lexer] Fix missing coverage line after #endif (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83514/new/ https://review

[PATCH] D83514: [Lexer] Fix missing coverage line after #endif

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu reopened this revision. zequanwu added a comment. This revision is now accepted and ready to land. Reverted. It broke unit test SemanticHighlighting.GetsCorrectTokens in clangd. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83514/new/ http

[PATCH] D83514: [Lexer] Fix missing coverage line after #endif

2020-07-09 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 276899. zequanwu added a comment. Herald added subscribers: usaxena95, kadircet, jkorous. Fix clangd unit test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83514/new/ https://reviews.llvm.org/D83514 Files: clang-tools-extra/clangd/SemanticHigh

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-10 Thread Zequan Wu via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG1fbb719470c6: [LPM] Port CGProfilePass from NPM to LPM (authored by zequanwu). Repository: rG LLVM Github Monorepo CHA

[PATCH] D83514: [Lexer] Fix missing coverage line after #endif

2020-07-10 Thread Zequan Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdcd76c0c0716: [Lexer] Fix missing coverage line after #endif (authored by zequanwu). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83514/new/ https://review

[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-10 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83013#2143470 , @hans wrote: > Still lgtm. For what it's worth, I think you could have just re-committed > with the fixes rather than uploading for review again. Gotcha, thanks. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-10 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added a reviewer: hans. Herald added a project: clang. Herald added a subscriber: cfe-commits. Not sure if this is good idea to untrack comments, it breaks many tests under CoverageMapping. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added inline comments. Herald added a subscriber: wuzish. Comment at: clang/lib/Parse/Parser.cpp:37 bool HandleComment(Preprocessor &PP, SourceRange Comment) override { +PP.getPPCallbacks()->SourceRangeSkipped(Comment, Comment.getEnd()); S.ActOnComment(Commen

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277518. zequanwu marked an inline comment as done. zequanwu added a comment. Herald added subscribers: kbarton, nemanjai. Classfiying comments as `SkippedRegion`, https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/ProfileData/Coverage/Coverag

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2147881 , @hans wrote: > > Not sure if this is good idea to untrack comments, it breaks many tests > > under CoverageMapping. > > I didn't look, but I'm surprised there are many coverage tests that have > comments in t

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277538. zequanwu added a comment. Herald added subscribers: llvm-commits, hiraditya. Herald added a project: LLVM. Merge overlapped `SkippedRegion`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ htt

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added a comment. In D83592#2148376 , @vsk wrote: > taking advantage of the existing CommentHandler interface? To simplify > things, we can add a static method like > 'CoverageMappingGen::setupPreprocess

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277605. zequanwu added a comment. Vedant, thanks for your suggestions. - Remove merging function. - Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked an inline comment as done. zequanwu added inline comments. Comment at: llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp:152 +static MutableArrayRef +mergeSkippedRegions(MutableArrayRef MappingRegions) { + SmallVector MergedRegions; vsk wro

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277606. zequanwu added a comment. Remove old code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: a.out a.profdata clang/lib/CodeGen/CodeGenAction.cpp

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277611. zequanwu added a comment. Accidentally uploaded binary.. removed now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/lib/CodeGen/CodeGenAction.

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-13 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. For those test cases, I could either moving the comments inside a function to outside or change `CHECK-NEXT` to `CHECK` In D83592#2148833 , @vsk wrote: > Before updating any tests, maybe it's worth doing a quick experiment with

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-14 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277909. zequanwu added a comment. Fix failed test cases with sed to remove comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/lib/CodeGen/CodeGen

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-14 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277986. zequanwu added a comment. Add lit substitution `%strip_comments -> sed 's/\/\/.*//' %s > %T/%basename_t`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-14 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 277988. zequanwu added a comment. `%strip_comments` -> `sed 's/[ \t]*\/\/.*//' %s > %T/%basename_t`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83592/new/ https://reviews.llvm.org/D83592 Files: clang/lib

[PATCH] D83592: [Parser] Add comment to skipped regions

2020-07-14 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D83592#2151217 , @vsk wrote: > Could you add an end-to-end llvm-cov test (see e.g. > compiler-rt/test/profile/Linux/coverage_ctors.cpp)? Here are some important > cases I think we should check: > > - `/* comment at the start

[PATCH] D79895: Add a new warning to warn when passing uninitialized variables as const reference parameters to a function

2020-06-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D79895#2107604 , @nick wrote: > This diagnostic bring headaches because frequently `-Wunused-variable` > suppression is done via no-op pseudo-consuming function like > `boost::ignore_unused` >

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-06-23 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added reviewers: hans, nick. Herald added a project: clang. Herald added a subscriber: cfe-commits. Some libraries use empty function to ignore unused variable warnings, which gets a new warning from `-Wuninitialized-const-reference`, discussed here https

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-06-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked 2 inline comments as done. zequanwu added inline comments. Comment at: clang/lib/Analysis/UninitializedValues.cpp:410 + if (FunctionDecl *fd = CE->getDirectCallee()) { +if (FunctionTemplateDecl *ftd = fd->getPrimaryTemplate()) + return ftd->getTemplatedD

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-06-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 273103. zequanwu marked an inline comment as done. zequanwu added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82425/new/ https://reviews.llvm.org/D82425 Files: clang/lib/Analy

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-06-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 273184. zequanwu marked an inline comment as done. zequanwu added a comment. Add test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82425/new/ https://reviews.llvm.org/D82425 Files: clang/lib/Analysi

[PATCH] D82425: [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body.

2020-06-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu marked 2 inline comments as done. zequanwu added inline comments. Comment at: clang/lib/Analysis/UninitializedValues.cpp:435 if ((*I)->getType().isConstQualified()) -classify((*I), ConstRefUse); +if (!hasTrivialBody(CE)) + classify((*I), C

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu created this revision. zequanwu added reviewers: asbirlea, rnk. zequanwu added projects: LLVM, clang. Herald added subscribers: cfe-commits, hiraditya. We want to add a way to avoid tail calls to noreturn function from being merged. This patch add nomerge to disable the optimization in

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 259455. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78659/new/ https://reviews.llvm.org/D78659 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/attr-nomerge.c

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-22 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. In D78659#1997528 , @lebedev.ri wrote: > 1. Tests missing > 2. Why isn't `noinline` sufficient, why a whole new attribue? 1. Test added. 2. We want to avoid merging multiple call sites of same function, but `noinline` cannot

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 259938. Herald added subscribers: dexonsmith, steven_wu. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78659/new/ https://reviews.llvm.org/D78659 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/lib/CodeGen/

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 260038. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78659/new/ https://reviews.llvm.org/D78659 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/lib/CodeGen/CGCall.cpp clang/test/CodeGen/attr-nomerge.c

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-24 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 260039. zequanwu added a comment. Add check in LICM to prevent sink or hoist on `nomerge` call CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78659/new/ https://reviews.llvm.org/D78659 Files: clang/include/clang/Basic/Attr.td clang/include/clan

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-27 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 260529. zequanwu added a comment. Split the the original differential to 2 smaller ones. This one add nomerge function attribute in IR level. Another one will add the attribute to let frontend recognize it. CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-28 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu added a comment. > Does sinking and hoisting remove the debug source location? I assumed that it > wouldn't, but now after all the smooth stepping work, maybe it does. Yes, both sinking and hoisting in simplifycfg remove the debug source location by `Instruction::applyMergedLocation` s

[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

2020-04-28 Thread Zequan Wu via Phabricator via cfe-commits
zequanwu updated this revision to Diff 260780. zequanwu added a comment. Add test case for preventing hoisting. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78659/new/ https://reviews.llvm.org/D78659 Files: llvm/docs/LangRef.rst llvm/include/llvm/Bitcode/LLVMBitCodes.h llvm/incl

  1   2   3   4   5   >