SuccessChanges

Summary

  1. [ArgPromotion] Preserve alignment of byval argument in new alloca The frontend may have requested a higher alignment for any reason, and downstream optimizations may already have taken advantage of it. We should keep the same alignment when moving the allocation from the parameter area to the local variable area. Fixes PR34038
  2. clang-format: [JS] support fields with case/switch/default labels. Summary: `case:` and `default:` would normally parse as labels for a `switch` block. However in TypeScript, they can be used in field declarations, e.g.: interface I { case: string; } This change special cases parsing them in declaration lines to avoid wrapping them. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36148
  3. [ConstantInt] Use ConstantInt::getValue instead of Constant::getUniqueInteger in a few places where we obviously have a ConstantInt. NFC getUniqueInteger will ultimately call ConstantInt::getValue, but calling ConstantInt::getValue should be inlined.
  4. [AArch64] Fix an assertion for pre-index generation with unscaled loads/stores. Differential Revision: https://reviews.llvm.org/D36248 PR34035
  5. Adjust the hotness threshold from 99.9% to 99%. Summary: We originally set the hotness threshold as 99.9% to be consistent with gcc FDO. But because the inline heuristic is different between 2 compilers: llvm uses bottom-up algorithm while gcc uses priority based. The LLVM algorithm tends to inline too much early that prevents hot callsites from further inlined into its caller. Due to this restriction, we think it is reasonable to lower the hotness threshold to give priority to those that are really hot. Our experiments show that this change would improve performance on large applications. Note that the inline heuristic has great room for further tuning. Once the inline heuristics are refined, we could adjust this threshold to allow inlining for less hot callsites. Reviewers: davidxl, tejohnson, eraman Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D36317
  6. [InstCombine] Fold single-use variable into assert. Avoids unused variable warnings in Release builds. No functional change.
  7. [InstCombine] Remove the (not (sext)) case from foldBoolSextMaskToSelect and inline the remaining code to match visitOr Summary: The (not (sext)) case is really (xor (sext), -1) which should have been simplified to (sext (xor, 1)) before we got here. So we shouldn't need to handle it. With that taken care of we only need to two cases so don't need the swap anymore. This makes us in sync with the equivalent code in visitOr so inline this to match. Reviewers: spatel, eli.friedman, majnemer Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36240
  8. [InstCombine] Use ConstantInt::getFalse to reduce some code. NFC
  9. [ThinLTO] Add FunctionAttrs to ThinLTO index Adds function attributes to index: ReadNone, ReadOnly, NoRecurse, NoAlias. This attributes will be used for future ThinLTO optimizations that will propagate function attributes across modules.
  10. [InstCombine] narrow lshr with constant Name: narrow_shift Pre: C1 < 8 %zx = zext i8 %x to i32 %l = lshr i32 %zx, C1 => %narrowC = trunc i32 C1 to i8 %ns = lshr i8 %x, %narrowC %l = zext i8 %ns to i32 http://rise4fun.com/Alive/jIV This isn't directly applicable to PR34046 as written, but we need to have more narrowing folds like this to be sure that rotate patterns are recognized.
Revision 310071 by rnk:
[ArgPromotion] Preserve alignment of byval argument in new alloca

The frontend may have requested a higher alignment for any reason, and
downstream optimizations may already have taken advantage of it.  We
should keep the same alignment when moving the allocation from the
parameter area to the local variable area.

Fixes PR34038
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cppllvm.src/lib/Transforms/IPO/ArgumentPromotion.cpp
The file was modified/llvm/trunk/test/Transforms/ArgumentPromotion/byval.llllvm.src/test/Transforms/ArgumentPromotion/byval.ll
Revision 310070 by mprobst:
clang-format: [JS] support fields with case/switch/default labels.

Summary:
`case:` and `default:` would normally parse as labels for a `switch` block.
However in TypeScript, they can be used in field declarations, e.g.:

    interface I {
      case: string;
    }

This change special cases parsing them in declaration lines to avoid wrapping
them.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D36148
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/lib/Format/UnwrappedLineParser.cppclang.src/lib/Format/UnwrappedLineParser.cpp
The file was modified/cfe/trunk/unittests/Format/FormatTestJS.cppclang.src/unittests/Format/FormatTestJS.cpp
Revision 310069 by ctopper:
[ConstantInt] Use ConstantInt::getValue instead of Constant::getUniqueInteger in a few places where we obviously have a ConstantInt. NFC

getUniqueInteger will ultimately call ConstantInt::getValue, but calling ConstantInt::getValue should be inlined.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Analysis/BranchProbabilityInfo.cppllvm.src/lib/Analysis/BranchProbabilityInfo.cpp
The file was modified/llvm/trunk/lib/Analysis/LazyValueInfo.cppllvm.src/lib/Analysis/LazyValueInfo.cpp
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cppllvm.src/lib/Target/AArch64/AArch64ISelLowering.cpp
Revision 310066 by mcrosier:
[AArch64] Fix an assertion for pre-index generation with unscaled loads/stores.

Differential Revision: https://reviews.llvm.org/D36248
PR34035
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cppllvm.src/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
The file was added/llvm/trunk/test/CodeGen/AArch64/arm64-ldst-unscaled-pre-post.mirllvm.src/test/CodeGen/AArch64/arm64-ldst-unscaled-pre-post.mir
Revision 310065 by dehao:
Adjust the hotness threshold from 99.9% to 99%.

Summary: We originally set the hotness threshold as 99.9% to be consistent with gcc FDO. But because the inline heuristic is different between 2 compilers: llvm uses bottom-up algorithm while gcc uses priority based. The LLVM algorithm tends to inline too much early that prevents hot callsites from further inlined into its caller. Due to this restriction, we think it is reasonable to lower the hotness threshold to give priority to those that are really hot. Our experiments show that this change would improve performance on large applications. Note that the inline heuristic has great room for further tuning. Once the inline heuristics are refined, we could adjust this threshold to allow inlining for less hot callsites.

Reviewers: davidxl, tejohnson, eraman

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits

Differential Revision: https://reviews.llvm.org/D36317
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Analysis/ProfileSummaryInfo.cppllvm.src/lib/Analysis/ProfileSummaryInfo.cpp
Revision 310064 by d0k:
[InstCombine] Fold single-use variable into assert.

Avoids unused variable warnings in Release builds. No functional change.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cppllvm.src/lib/Transforms/InstCombine/InstCombineShifts.cpp
Revision 310063 by ctopper:
[InstCombine] Remove the (not (sext)) case from foldBoolSextMaskToSelect and inline the remaining code to match visitOr

Summary:
The (not (sext)) case is really (xor (sext), -1) which should have been simplified to (sext (xor, 1)) before we got here. So we shouldn't need to handle it.

With that taken care of we only need to two cases so don't need the swap anymore. This makes us in sync with the equivalent code in visitOr so inline this to match.

Reviewers: spatel, eli.friedman, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36240
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cppllvm.src/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
The file was modified/llvm/trunk/test/Transforms/InstCombine/vector-casts.llllvm.src/test/Transforms/InstCombine/vector-casts.ll
Revision 310062 by ctopper:
[InstCombine] Use ConstantInt::getFalse to reduce some code. NFC
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cppllvm.src/lib/Transforms/InstCombine/InstCombineSelect.cpp
Revision 310061 by ncharlie:
[ThinLTO] Add FunctionAttrs to ThinLTO index

Adds function attributes to index: ReadNone, ReadOnly, NoRecurse, NoAlias. This attributes will be used for future ThinLTO optimizations that will propagate function attributes across modules.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.hllvm.src/include/llvm/IR/ModuleSummaryIndex.h
The file was modified/llvm/trunk/include/llvm/IR/ModuleSummaryIndexYAML.hllvm.src/include/llvm/IR/ModuleSummaryIndexYAML.h
The file was modified/llvm/trunk/lib/Analysis/ModuleSummaryAnalysis.cppllvm.src/lib/Analysis/ModuleSummaryAnalysis.cpp
The file was modified/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cppllvm.src/lib/Bitcode/Reader/BitcodeReader.cpp
The file was modified/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cppllvm.src/lib/Bitcode/Writer/BitcodeWriter.cpp
The file was modified/llvm/trunk/test/Bitcode/summary_version.llllvm.src/test/Bitcode/summary_version.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-alias.llllvm.src/test/Bitcode/thinlto-alias.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-alias2.llllvm.src/test/Bitcode/thinlto-alias2.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.llllvm.src/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.llllvm.src/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.llllvm.src/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.llllvm.src/test/Bitcode/thinlto-function-summary-callgraph.ll
The file was added/llvm/trunk/test/Bitcode/thinlto-function-summary-functionattrs.llllvm.src/test/Bitcode/thinlto-function-summary-functionattrs.ll
The file was modified/llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.llllvm.src/test/Bitcode/thinlto-function-summary-refgraph.ll
Revision 310060 by spatel:
[InstCombine] narrow lshr with constant

Name: narrow_shift
Pre: C1 < 8
%zx = zext i8 %x to i32
%l = lshr i32 %zx, C1
  => 
%narrowC = trunc i32 C1 to i8
%ns = lshr i8 %x, %narrowC
%l = zext i8 %ns to i32

http://rise4fun.com/Alive/jIV

This isn't directly applicable to PR34046 as written, but we
need to have more narrowing folds like this to be sure that
rotate patterns are recognized.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cppllvm.src/lib/Transforms/InstCombine/InstCombineShifts.cpp
The file was modified/llvm/trunk/test/Transforms/InstCombine/cast.llllvm.src/test/Transforms/InstCombine/cast.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/lshr.llllvm.src/test/Transforms/InstCombine/lshr.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/select-with-bitwise-ops.llllvm.src/test/Transforms/InstCombine/select-with-bitwise-ops.ll
The file was modified/llvm/trunk/test/Transforms/InstCombine/trunc.llllvm.src/test/Transforms/InstCombine/trunc.ll