[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-30 Thread Tim Shen via Phabricator via cfe-commits
timshen added inline comments. Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:443 + writeThinLTOBitcode(OS, ThinLinkOS, + [](Function ) -> AAResults & { +return FAM.getResult(F); chandlerc wrote: > Are

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-30 Thread Tim Shen via Phabricator via cfe-commits
timshen updated this revision to Diff 100761. timshen marked 12 inline comments as done. timshen added a comment. Updated based on the comments, and left out Clang changes for a separate patch. https://reviews.llvm.org/D33525 Files: llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-30 Thread Chandler Carruth via Phabricator via cfe-commits
chandlerc added inline comments. Comment at: llvm/test/Transforms/ThinLTOBitcodeWriter/new-pm.ll:1 +; RUN: opt -passes='lto' -debug-pass-manager -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s 2>&1 | FileCheck %s --check-prefix=DEBUG_PM +; RUN: llvm-bcanalyzer -dump %t2 |

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-30 Thread Tim Shen via Phabricator via cfe-commits
timshen added inline comments. Comment at: llvm/test/Transforms/ThinLTOBitcodeWriter/new-pm.ll:1 +; RUN: opt -passes='lto' -debug-pass-manager -thinlto-bc -thin-link-bitcode-file=%t2 -o %t %s 2>&1 | FileCheck %s --check-prefix=DEBUG_PM +; RUN: llvm-bcanalyzer -dump %t2 |

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-26 Thread Chandler Carruth via Phabricator via cfe-commits
chandlerc added inline comments. Comment at: clang/lib/CodeGen/BackendUtil.cpp:913-914 +std::error_code EC; +ThinLinkOS.emplace(CodeGenOpts.ThinLinkBitcodeFile, EC, + llvm::sys::fs::F_None); +if (EC) { The clang

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-26 Thread Tim Shen via Phabricator via cfe-commits
timshen updated this revision to Diff 100488. timshen added a comment. Add opt support and llvm test. https://reviews.llvm.org/D33525 Files: clang/lib/CodeGen/BackendUtil.cpp clang/test/CodeGen/thin_link_bitcode.c llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-26 Thread Chandler Carruth via Phabricator via cfe-commits
chandlerc added a comment. In https://reviews.llvm.org/D33525#766050, @timshen wrote: > In https://reviews.llvm.org/D33525#764251, @chandlerc wrote: > > > (focusing on the LLVM side of this review for now) > > > > Can you add an LLVM-based test? Can you add this to > >

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-26 Thread Tim Shen via Phabricator via cfe-commits
timshen marked an inline comment as done. timshen added a comment. In https://reviews.llvm.org/D33525#764251, @chandlerc wrote: > (focusing on the LLVM side of this review for now) > > Can you add an LLVM-based test? Can you add this to > `lib/Passes/PassRegistry.def`? Talked offline. Given

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-26 Thread Tim Shen via Phabricator via cfe-commits
timshen updated this revision to Diff 100462. timshen added a comment. Change the test case. https://reviews.llvm.org/D33525 Files: clang/lib/CodeGen/BackendUtil.cpp clang/test/CodeGen/thin_link_bitcode.c llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-25 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added inline comments. Comment at: clang/test/CodeGen/thin_link_bitcode.c:5 +// RUN: %clang_cc1 -o %t -flto=thin -fexperimental-new-pass-manager -fthin-link-bitcode=%t.newpm -triple x86_64-unknown-linux-gnu -emit-llvm-bc %s +// RUN: llvm-bcanalyzer -dump %t.newpm |

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-25 Thread Tim Shen via Phabricator via cfe-commits
timshen added a comment. In https://reviews.llvm.org/D33525#764251, @chandlerc wrote: > (focusing on the LLVM side of this review for now) > > Can you add an LLVM-based test? Can you add this to > `lib/Passes/PassRegistry.def`? I see that not all passes are registered (BitcodeWriterPass). Is

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-25 Thread Chandler Carruth via Phabricator via cfe-commits
chandlerc added a comment. (focusing on the LLVM side of this review for now) Can you add an LLVM-based test? Can you add this to `lib/Passes/PassRegistry.def`? Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:423 + +class AARGetter { + FunctionAnalysisManager

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-24 Thread Tim Shen via Phabricator via cfe-commits
timshen added inline comments. Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:423 + +class AARGetter { + FunctionAnalysisManager mehdi_amini wrote: > Can't you do it with a lambda? I can, except that AAR needs to be allocated outside of the

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-24 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added inline comments. Comment at: llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:423 + +class AARGetter { + FunctionAnalysisManager Can't you do it with a lambda? https://reviews.llvm.org/D33525

[PATCH] D33525: [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.

2017-05-24 Thread Tim Shen via Phabricator via cfe-commits
timshen created this revision. Herald added subscribers: eraman, inglorion, Prazek, mehdi_amini. Also see https://reviews.llvm.org/D33429 for other ThinLTO + New PM related changes. https://reviews.llvm.org/D33525 Files: clang/lib/CodeGen/BackendUtil.cpp