FailedChanges

Summary

  1. [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls Summary: When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call. Eg. ``` std::vector<std::pair<int, int>> v; v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2); ``` make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions. Reviewers: Prazek, aaron.ballman, hokein, alexfh Reviewed By: Prazek, alexfh Subscribers: JDevlieghere, JonasToth, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32395
  2. CMake: ignore git stderr when trying to sort out revision. NFC.
  3. [InlineCost] Improve the cost heuristic for Switch Summary: The motivation example is like below which has 13 cases but only 2 distinct targets ``` lor.lhs.false2: ; preds = %if.then switch i32 %Status, label %if.then27 [ i32 -7012, label %if.end35 i32 -10008, label %if.end35 i32 -10016, label %if.end35 i32 15000, label %if.end35 i32 14013, label %if.end35 i32 10114, label %if.end35 i32 10107, label %if.end35 i32 10105, label %if.end35 i32 10013, label %if.end35 i32 10011, label %if.end35 i32 7008, label %if.end35 i32 7007, label %if.end35 i32 5002, label %if.end35 ] ``` which is compiled into a balanced binary tree like this on AArch64 (similar on X86) ``` .LBB853_9: // %lor.lhs.false2 mov w8, #10012 cmp w19, w8 b.gt .LBB853_14 // BB#10: // %lor.lhs.false2 mov w8, #5001 cmp w19, w8 b.gt .LBB853_18 // BB#11: // %lor.lhs.false2 mov w8, #-10016 cmp w19, w8 b.eq .LBB853_23 // BB#12: // %lor.lhs.false2 mov w8, #-10008 cmp w19, w8 b.eq .LBB853_23 // BB#13: // %lor.lhs.false2 mov w8, #-7012 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_14: // %lor.lhs.false2 mov w8, #14012 cmp w19, w8 b.gt .LBB853_21 // BB#15: // %lor.lhs.false2 mov w8, #-10105 add w8, w19, w8 cmp w8, #9 // =9 b.hi .LBB853_17 // BB#16: // %lor.lhs.false2 orr w9, wzr, #0x1 lsl w8, w9, w8 mov w9, #517 and w8, w8, w9 cbnz w8, .LBB853_23 .LBB853_17: // %lor.lhs.false2 mov w8, #10013 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_18: // %lor.lhs.false2 mov w8, #-7007 add w8, w19, w8 cmp w8, #2 // =2 b.lo .LBB853_23 // BB#19: // %lor.lhs.false2 mov w8, #5002 cmp w19, w8 b.eq .LBB853_23 // BB#20: // %lor.lhs.false2 mov w8, #10011 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_21: // %lor.lhs.false2 mov w8, #14013 cmp w19, w8 b.eq .LBB853_23 // BB#22: // %lor.lhs.false2 mov w8, #15000 cmp w19, w8 b.ne .LBB853_3 ``` However, the inline cost model estimates the cost to be linear with the number of distinct targets and the cost of the above switch is just 2 InstrCosts. The function containing this switch is then inlined about 900 times. This change use the general way of switch lowering for the inline heuristic. It etimate the number of case clusters with the suitability check for a jump table or bit test. Considering the binary search tree built for the clusters, this change modifies the model to be linear with the size of the balanced binary tree. The model is off by default for now : -inline-generic-switch-cost=false This change was originally proposed by Haicheng in D29870. Reviewers: hans, bmakam, chandlerc, eraman, haicheng, mcrosier Reviewed By: hans Subscribers: joerg, aemerson, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D31085
  4. [libclang] Expose some target information via the C API. This allows users to query the target triple and target pointer width, which would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and other related bugs in an elegant way (without having to manually parse the target triple in the command line arguments). Differential Revision: https://reviews.llvm.org/D32389
Revision 301651 by kuhar:
[clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

Summary:
When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call.

Eg.

```
std::vector<std::pair<int, int>> v;
v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2);
```

make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions.

Reviewers: Prazek, aaron.ballman, hokein, alexfh

Reviewed By: Prazek, alexfh

Subscribers: JDevlieghere, JonasToth, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D32395
Change TypePath in RepositoryPath in Workspace
The file was modified/clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp (diff)llvm-revision.src/clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp
The file was modified/clang-tools-extra/trunk/docs/ReleaseNotes.rst (diff)llvm-revision.src/clang-tools-extra/trunk/docs/ReleaseNotes.rst
The file was modified/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst (diff)llvm-revision.src/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst
The file was modified/clang-tools-extra/trunk/test/clang-tidy/modernize-use-emplace.cpp (diff)llvm-revision.src/clang-tools-extra/trunk/test/clang-tidy/modernize-use-emplace.cpp
Revision 301650 by Tim Northover:
CMake: ignore git stderr when trying to sort out revision. NFC.
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/cmake/modules/VersionFromVCS.cmake (diff)llvm-revision.src/llvm/trunk/cmake/modules/VersionFromVCS.cmake
The file was modified/llvm/trunk/include/llvm/Support/CMakeLists.txt (diff)llvm-revision.src/llvm/trunk/include/llvm/Support/CMakeLists.txt
Revision 301649 by junbuml:
[InlineCost] Improve the cost heuristic for Switch

Summary:
The motivation example is like below which has 13 cases but only 2 distinct targets

```
lor.lhs.false2:                                   ; preds = %if.then
  switch i32 %Status, label %if.then27 [
    i32 -7012, label %if.end35
    i32 -10008, label %if.end35
    i32 -10016, label %if.end35
    i32 15000, label %if.end35
    i32 14013, label %if.end35
    i32 10114, label %if.end35
    i32 10107, label %if.end35
    i32 10105, label %if.end35
    i32 10013, label %if.end35
    i32 10011, label %if.end35
    i32 7008, label %if.end35
    i32 7007, label %if.end35
    i32 5002, label %if.end35
  ]
```
which is compiled into a balanced binary tree like this on AArch64 (similar on X86)

```
.LBB853_9:                              // %lor.lhs.false2
        mov     w8, #10012
        cmp             w19, w8
        b.gt    .LBB853_14
// BB#10:                               // %lor.lhs.false2
        mov     w8, #5001
        cmp             w19, w8
        b.gt    .LBB853_18
// BB#11:                               // %lor.lhs.false2
        mov     w8, #-10016
        cmp             w19, w8
        b.eq    .LBB853_23
// BB#12:                               // %lor.lhs.false2
        mov     w8, #-10008
        cmp             w19, w8
        b.eq    .LBB853_23
// BB#13:                               // %lor.lhs.false2
        mov     w8, #-7012
        cmp             w19, w8
        b.eq    .LBB853_23
        b       .LBB853_3
.LBB853_14:                             // %lor.lhs.false2
        mov     w8, #14012
        cmp             w19, w8
        b.gt    .LBB853_21
// BB#15:                               // %lor.lhs.false2
        mov     w8, #-10105
        add             w8, w19, w8
        cmp             w8, #9          // =9
        b.hi    .LBB853_17
// BB#16:                               // %lor.lhs.false2
        orr     w9, wzr, #0x1
        lsl     w8, w9, w8
        mov     w9, #517
        and             w8, w8, w9
        cbnz    w8, .LBB853_23
.LBB853_17:                             // %lor.lhs.false2
        mov     w8, #10013
        cmp             w19, w8
        b.eq    .LBB853_23
        b       .LBB853_3
.LBB853_18:                             // %lor.lhs.false2
        mov     w8, #-7007
        add             w8, w19, w8
        cmp             w8, #2          // =2
        b.lo    .LBB853_23
// BB#19:                               // %lor.lhs.false2
        mov     w8, #5002
        cmp             w19, w8
        b.eq    .LBB853_23
// BB#20:                               // %lor.lhs.false2
        mov     w8, #10011
        cmp             w19, w8
        b.eq    .LBB853_23
        b       .LBB853_3
.LBB853_21:                             // %lor.lhs.false2
        mov     w8, #14013
        cmp             w19, w8
        b.eq    .LBB853_23
// BB#22:                               // %lor.lhs.false2
        mov     w8, #15000
        cmp             w19, w8
        b.ne    .LBB853_3
```
However, the inline cost model estimates the cost to be linear with the number
of distinct targets and the cost of the above switch is just 2 InstrCosts.
The function containing this switch is then inlined about 900 times.

This change use the general way of switch lowering for the inline heuristic. It
etimate the number of case clusters with the suitability check for a jump table
or bit test. Considering the binary search tree built for the clusters, this
change modifies the model to be linear with the size of the balanced binary
tree. The model is off by default for now :
  -inline-generic-switch-cost=false

This change was originally proposed by Haicheng in D29870.

Reviewers: hans, bmakam, chandlerc, eraman, haicheng, mcrosier

Reviewed By: hans

Subscribers: joerg, aemerson, llvm-commits, rengolin

Differential Revision: https://reviews.llvm.org/D31085
Change TypePath in RepositoryPath in Workspace
The file was modified/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (diff)llvm-revision.src/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h
The file was modified/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h (diff)llvm-revision.src/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h
The file was modified/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h (diff)llvm-revision.src/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h
The file was modified/llvm/trunk/include/llvm/Target/TargetLowering.h (diff)llvm-revision.src/llvm/trunk/include/llvm/Target/TargetLowering.h
The file was modified/llvm/trunk/lib/Analysis/InlineCost.cpp (diff)llvm-revision.src/llvm/trunk/lib/Analysis/InlineCost.cpp
The file was modified/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (diff)llvm-revision.src/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp
The file was modified/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (diff)llvm-revision.src/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modified/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (diff)llvm-revision.src/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
The file was modified/llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp (diff)llvm-revision.src/llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
The file was added/llvm/trunk/test/Transforms/Inline/AArch64/switch.llllvm-revision.src/llvm/trunk/test/Transforms/Inline/AArch64/switch.ll
Revision 301648 by emilio:
[libclang] Expose some target information via the C API.

This allows users to query the target triple and target pointer width, which
would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and
other related bugs in an elegant way (without having to manually parse the
target triple in the command line arguments).

Differential Revision: https://reviews.llvm.org/D32389
Change TypePath in RepositoryPath in Workspace
The file was modified/cfe/trunk/include/clang-c/Index.h (diff)llvm-revision.src/cfe/trunk/include/clang-c/Index.h
The file was added/cfe/trunk/test/Index/target-info.cllvm-revision.src/cfe/trunk/test/Index/target-info.c
The file was modified/cfe/trunk/tools/c-index-test/c-index-test.c (diff)llvm-revision.src/cfe/trunk/tools/c-index-test/c-index-test.c
The file was modified/cfe/trunk/tools/libclang/CIndex.cpp (diff)llvm-revision.src/cfe/trunk/tools/libclang/CIndex.cpp
The file was modified/cfe/trunk/tools/libclang/CXTranslationUnit.h (diff)llvm-revision.src/cfe/trunk/tools/libclang/CXTranslationUnit.h
The file was modified/cfe/trunk/tools/libclang/libclang.exports (diff)llvm-revision.src/cfe/trunk/tools/libclang/libclang.exports