1. Jun 22, 2019
  2. Jun 21, 2019
    • Eric Fiselier's avatar
      Use rvalue references throughout the is_constructible traits. · e652f809
      Eric Fiselier authored
      llvm-svn: 364065
      e652f809
    • David Bolvansky's avatar
      [InstCombine] cttz(abs(x)) -> cttz(x) · 4b284783
      David Bolvansky authored
      Summary: Signedness does not change number of trailing zeros.
      
      Reviewers: spatel, lebedev.ri, nikic
      
      Reviewed By: lebedev.ri
      
      Differential Revision: https://reviews.llvm.org/D63546
      
      llvm-svn: 364064
      4b284783
    • Eric Fiselier's avatar
      Make move and forward work in C++03. · 000f25a3
      Eric Fiselier authored
      These functions are key to allowing the use of rvalues and variadics
      in C++03 mode. Everything works the same as in C++11, except for one
      tangentially related case:
      
      struct T {
        T(T &&) = default;
      };
      
      In C++11, T has a deleted copy constructor. But in C++03 Clang gives
      it both a move and a copy constructor. This seems reasonable enough
      given the extensions it's using.
      
      The other changes in this patch were the minimal set required
      to keep the tests passing after the move/forward change. Most notably
      the removal of the `__rv<unique_ptr>` hack that was present
      in an attempt to make unique_ptr move only without language support.
      
      llvm-svn: 364063
      000f25a3
    • Sanjay Patel's avatar
      [GVNSink] prevent crashing on mismatched instructions (PR42346) · ddb90936
      Sanjay Patel authored
      Patch based on suggestion by James Molloy (@jmolloy) in:
      https://bugs.llvm.org/show_bug.cgi?id=42346
      
      llvm-svn: 364062
      ddb90936
    • Alexey Bataev's avatar
      [OPENMP]Fix PR42159: do not capture threadprivate variables. · e0eb66bb
      Alexey Bataev authored
      The threadprivate variables should not be captured in the outlined
      regions, otherwise it leads to the compiler crash.
      
      llvm-svn: 364061
      e0eb66bb
    • David Bolvansky's avatar
      [NFC] Added tests for (1 << (C - x)) -> ((1 << C) >> x) · b0ba049f
      David Bolvansky authored
      llvm-svn: 364060
      b0ba049f
    • Simon Pilgrim's avatar
      [DAGCombine] narrowInsertExtractVectorBinOp - reuse "extract from insert" detection code. · ca9933c2
      Simon Pilgrim authored
      Move the "extract from insert detection code" into a lambda helper function.
      
      llvm-svn: 364059
      ca9933c2
    • Eric Fiselier's avatar
      Enable aligned_union in C++03 · f044ebeb
      Eric Fiselier authored
      llvm-svn: 364058
      f044ebeb
    • Eric Fiselier's avatar
      Get is_convertible tests passing in C++03 (except the fallback). · b6a9afa8
      Eric Fiselier authored
      llvm-svn: 364057
      b6a9afa8
    • James Henderson's avatar
      [docs][llvm-objdump] Fix bad merge of docs · f7212dbe
      James Henderson authored
      llvm-svn: 364056
      f7212dbe
    • Aaron Ballman's avatar
      Add an automated note to files produced by gen_ast_dump_json_test.py. · 60294f9d
      Aaron Ballman authored
      This also details what filters, if any, were used to generate the test output. Updates all the current JSON testing files to include the automated note.
      
      llvm-svn: 364055
      60294f9d
    • Eric Fiselier's avatar
      Remove dead non-variadic workarounds in <type_traits> · 3503d84a
      Eric Fiselier authored
      We can use variadics with clang
      
      llvm-svn: 364054
      3503d84a
    • Eric Fiselier's avatar
      Make rvalue metaprogramming traits work in C++03. · 87cf92d9
      Eric Fiselier authored
      The next step is to get move and forward working in C++03.
      
      llvm-svn: 364053
      87cf92d9
    • George Rimar's avatar
      [llvm-objcopy] - Get rid of dynrel.elf precompiled binary from inputs. · fa1c7d9b
      George Rimar authored
      We do not have to spread using the precompiled binaries in the tests,
      when we can use YAML. This patch removes the dynrel.elf binary and adds
      a few comments to the test cases.
      
      Differential revision: https://reviews.llvm.org/D63641
      
      llvm-svn: 364052
      fa1c7d9b
    • Jay Foad's avatar
      [Scalarizer] Propagate IR flags · d9d3c91b
      Jay Foad authored
      Summary:
      The motivation for this was to propagate fast-math flags like nnan and
      ninf on vector floating point operations to the corresponding scalar
      operations to take advantage of follow-on optimizations. But I think
      the same argument applies to all of our IR flags: if they apply to the
      vector operation then they also apply to all the individual scalar
      operations, and they might enable follow-on optimizations.
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63593
      
      llvm-svn: 364051
      d9d3c91b
    • Eric Fiselier's avatar
      Remove even more dead code. · 5b4cc84b
      Eric Fiselier authored
      llvm-svn: 364050
      5b4cc84b
    • George Rimar's avatar
      [llvm-readobj] - Inline a few yaml inputs into test cases. · 0a32c07c
      George Rimar authored
      There are some test that are splitted into main part + input yaml for no visible reason.
      This patch inines the yaml part for the 3 test cases I found.
      
      Differential revision: https://reviews.llvm.org/D63644
      
      llvm-svn: 364049
      0a32c07c
    • Andrea Di Biagio's avatar
      Set an explicit x86 triple for test bottleneck-analysis.s added by my r364045. NFC · dd0dc19b
      Andrea Di Biagio authored
      This should unbreak the ppc64 buildbots.
      
      llvm-svn: 364048
      dd0dc19b
    • Eric Fiselier's avatar
      Assume __is_final, __is_base_of, and friends. · 395c7330
      Eric Fiselier authored
      All the compilers we support provide these builtins. We don't
      need to do a configuration dance anymore.
      
      This patch also cleans up some dead or almost dead
      C++11 feature detection macros.
      
      llvm-svn: 364047
      395c7330
    • Sam Elliott's avatar
      [RISCV] Add RISCV-specific TargetTransformInfo · 96c8bc79
      Sam Elliott authored
      Summary:
      LLVM Allows Targets to provide information that guides optimisations
      made to LLVM IR. This is done with callbacks on a TargetTransformInfo object.
      
      This patch adds a TargetTransformInfo class for RISC-V. This will allow us to
      implement RISC-V specific callbacks as they become necessary.
      
      This commit also adds the getIntImmCost callbacks, and tests them with a simple
      constant hoisting test. Our immediate costs are on the conservative side, for
      the moment, but we prevent hoisting in most circumstances anyway.
      
      Previous review was on D63007
      
      Reviewers: asb, luismarques
      
      Reviewed By: asb
      
      Subscribers: ributzka, MaskRay, llvm-commits, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, hiraditya, mgorny
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D63433
      
      llvm-svn: 364046
      96c8bc79
    • Andrea Di Biagio's avatar
      [MCA][Bottleneck Analysis] Teach how to compute a critical sequence of... · aa9b6468
      Andrea Di Biagio authored
      [MCA][Bottleneck Analysis] Teach how to compute a critical sequence of instructions based on the simulation.
      
      This patch teaches the bottleneck analysis how to identify and print the most
      expensive sequence of instructions according to the simulation. Fixes PR37494.
      
      The goal is to help users identify the sequence of instruction which is most
      critical for performance.
      
      A dependency graph is internally used by the bottleneck analysis to describe
      data dependencies and processor resource interferences between instructions.
      
      There is one node in the graph for every instruction in the input assembly
      sequence. The number of nodes in the graph is independent from the number of
      iterations simulated by the tool. It means that a single node of the graph
      represents all the possible instances of a same instruction contributed by the
      simulated iterations.
      
      Edges are dynamically "discovered" by the bottleneck analysis by observing
      instruction state transitions and "backend pressure increase" events generated
      by the Execute stage. Information from the events is used to identify critical
      dependencies, and materialize edges in the graph. A dependency edge is uniquely
      identified by a pair of node identifiers plus an instance of struct
      DependencyEdge::Dependency (which provides more details about the actual
      dependency kind).
      
      The bottleneck analysis internally ranks dependency edges based on their impact
      on the runtime (see field DependencyEdge::Dependency::Cost). To this end, each
      edge of the graph has an associated cost. By default, the cost of an edge is a
      function of its latency (in cycles). In practice, the cost of an edge is also a
      function of the number of cycles where the dependency has been seen as
      'contributing to backend pressure increases'. The idea is that the higher the
      cost of an edge, the higher is the impact of the dependency on performance. To
      put it in another way, the cost of an edge is a measure of criticality for
      performance.
      
      Note how a same edge may be found in multiple iteration of the simulated loop.
      The logic that adds new edges to the graph checks if an equivalent dependency
      already exists (duplicate edges are not allowed). If an equivalent dependency
      edge is found, field DependencyEdge::Frequency of that edge is incremented by
      one, and the new cost is cumulatively added to the existing edge cost.
      
      At the end of simulation, costs are propagated to nodes through the edges of the
      graph. The goal is to identify a critical sequence from a node of the root-set
      (composed by node of the graph with no predecessors) to a 'sink node' with no
      successors.  Note that the graph is intentionally kept acyclic to minimize the
      complexity of the critical sequence computation algorithm (complexity is
      currently linear in the number of nodes in the graph).
      
      The critical path is finally computed as a sequence of dependency edges. For
      edges describing processor resource interferences, the view also prints a
      so-called "interference probability" value (by dividing field
      DependencyEdge::Frequency by the total number of iterations).
      
      Examples of critical sequence computations can be found in tests added/modified
      by this patch.
      
      On output streams that support colored output, instructions from the critical
      sequence are rendered with a different color.
      
      Strictly speaking the analysis conducted by the bottleneck analysis view is not
      a critical path analysis. The cost of an edge doesn't only depend on the
      dependency latency. More importantly, the cost of a same edge may be computed
      differently by different iterations.
      
      The number of dependencies is discovered dynamically based on the events
      generated by the simulator. However, their number is not fixed. This is
      especially true for edges that model processor resource interferences; an
      interference may not occur in every iteration. For that reason, it makes sense
      to also print out a "probability of interference".
      
      By construction, the accuracy of this analysis (as always) is strongly dependent
      on the simulation (and therefore the quality of the information available in the
      scheduling model).
      
      That being said, the critical sequence effectively identifies a performance
      criticality. Instructions from that sequence are expected to have a very big
      impact on performance. So, users can take advantage of this information to focus
      their attention on specific interactions between instructions.
      In my experience, it works quite well in practice, and produces useful
      output (in a reasonable amount time).
      
      Differential Revision: https://reviews.llvm.org/D63543
      
      llvm-svn: 364045
      aa9b6468
    • Haojian Wu's avatar
      [clangd] Add include-mapping for C symbols. · 34f5188d
      Haojian Wu authored
      Summary:
      This resolves the issue of introducing c++-style includes for C files.
      
      - refactor the gen_std.py, make it reusable for parsing C symbols.
      - add a language mode to the mapping method to use different mapping for
        C and C++ files.
      
      Reviewers: kadircet
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D63270
      
      llvm-svn: 364044
      34f5188d