1. Jul 06, 2019
  2. Jul 05, 2019
    • Matt Arsenault's avatar
      ScheduleDAG: Fix incorrectly killing registers in bundles · 27a6985d
      Matt Arsenault authored
      When looking for uses/defs to add kill flags, the iterator was double
      incremented, skipping the first instruction in the bundle. The use
      register in the first bundle instruction was then incorrectly killed.
      The "First" instruction should be the BUNDLE itself as the proper
      reverse iterator endpoint.
      
      llvm-svn: 365216
      27a6985d
    • Eugene Leviant's avatar
      [ThinLTO] Attempt to recommit r365188 after alignment fix · 3aef3528
      Eugene Leviant authored
      llvm-svn: 365215
      3aef3528
    • David Green's avatar
      [ARM] MVE patterns for VMVN, VORR and VBIC · 47afdaa4
      David Green authored
      This add simple Q register forms of bitwise not instructions.
      
      Differential Revision: https://reviews.llvm.org/D63983
      
      llvm-svn: 365214
      47afdaa4
    • Nico Weber's avatar
      gn build: Merge r365203 · df173bf9
      Nico Weber authored
      llvm-svn: 365213
      df173bf9
    • Nico Weber's avatar
      Add a comment explaining why a function exists · 2bca3d4f
      Nico Weber authored
      llvm-svn: 365212
      2bca3d4f
    • Jay Foad's avatar
      [AMDGPU] DPP combiner: recognize identities for more opcodes · 7e0c10b5
      Jay Foad authored
      Summary:
      This allows the DPP combiner to kick in more often. For example the
      exclusive scan generated by the atomic optimizer for a divergent atomic
      add used to look like this:
      
              v_mov_b32_e32 v3, v1
              v_mov_b32_e32 v5, v1
              v_mov_b32_e32 v6, v1
              v_mov_b32_dpp v3, v2  wave_shr:1 row_mask:0xf bank_mask:0xf
              s_nop 1
              v_add_u32_dpp v4, v3, v3  row_shr:1 row_mask:0xf bank_mask:0xf bound_ctrl:0
              v_mov_b32_dpp v5, v3  row_shr:2 row_mask:0xf bank_mask:0xf
              v_mov_b32_dpp v6, v3  row_shr:3 row_mask:0xf bank_mask:0xf
              v_add3_u32 v3, v4, v5, v6
              v_mov_b32_e32 v4, v1
              s_nop 1
              v_mov_b32_dpp v4, v3  row_shr:4 row_mask:0xf bank_mask:0xe
              v_add_u32_e32 v3, v3, v4
              v_mov_b32_e32 v4, v1
              s_nop 1
              v_mov_b32_dpp v4, v3  row_shr:8 row_mask:0xf bank_mask:0xc
              v_add_u32_e32 v3, v3, v4
              v_mov_b32_e32 v4, v1
              s_nop 1
              v_mov_b32_dpp v4, v3  row_bcast:15 row_mask:0xa bank_mask:0xf
              v_add_u32_e32 v3, v3, v4
              s_nop 1
              v_mov_b32_dpp v1, v3  row_bcast:31 row_mask:0xc bank_mask:0xf
              v_add_u32_e32 v1, v3, v1
              v_add_u32_e32 v1, v2, v1
              v_readlane_b32 s0, v1, 63
      
      But now most of the dpp movs are combined into adds:
      
              v_mov_b32_e32 v3, v1
              v_mov_b32_e32 v5, v1
              s_nop 0
              v_mov_b32_dpp v3, v2  wave_shr:1 row_mask:0xf bank_mask:0xf
              s_nop 1
              v_add_u32_dpp v4, v3, v3  row_shr:1 row_mask:0xf bank_mask:0xf bound_ctrl:0
              v_mov_b32_dpp v5, v3  row_shr:2 row_mask:0xf bank_mask:0xf
              v_mov_b32_dpp v1, v3  row_shr:3 row_mask:0xf bank_mask:0xf
              v_add3_u32 v1, v4, v5, v1
              s_nop 1
              v_add_u32_dpp v1, v1, v1  row_shr:4 row_mask:0xf bank_mask:0xe
              s_nop 1
              v_add_u32_dpp v1, v1, v1  row_shr:8 row_mask:0xf bank_mask:0xc
              s_nop 1
              v_add_u32_dpp v1, v1, v1  row_bcast:15 row_mask:0xa bank_mask:0xf
              s_nop 1
              v_add_u32_dpp v1, v1, v1  row_bcast:31 row_mask:0xc bank_mask:0xf
              v_add_u32_e32 v1, v2, v1
              v_readlane_b32 s0, v1, 63
      
      Reviewers: arsenm, vpykhtin
      
      Subscribers: kzhuravl, nemanjai, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kbarton, MaskRay, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64207
      
      llvm-svn: 365211
      7e0c10b5
    • Hamza Sood's avatar
      NFC: Add an explicit return for safety and consistency · d14003d9
      Hamza Sood authored
      This case implicitly falls-through, which is fine now as it's at the end of the
      function, but it seems like an accident waiting to happen.
      
      llvm-svn: 365210
      d14003d9
    • Kristof Umann's avatar
      c8499ae3
    • Kristof Umann's avatar
      b5574560
    • Kristof Umann's avatar
      [analyzer] Track terminator conditions on which a tracked expression depends · 258e5e45
      Kristof Umann authored
      This patch is a major part of my GSoC project, aimed to improve the bug
      reports of the analyzer.
      
      TL;DR: Help the analyzer understand that some conditions are important,
      and should be explained better. If an CFGBlock is a control dependency
      of a block where an expression value is tracked, explain the condition
      expression better by tracking it.
      
      if (A) // let's explain why we believe A to be true
        10 / x; // division by zero
      
      This is an experimental feature, and can be enabled by the
      off-by-default analyzer configuration "track-conditions".
      
      In detail:
      
      This idea was inspired by the program slicing algorithm. Essentially,
      two things are used to produce a program slice (a subset of the program
      relevant to a (statement, variable) pair): data and control
      dependencies. The bug path (the linear path in the ExplodedGraph that leads
      from the beginning of the analysis to the error node) enables to
      analyzer to argue about data dependencies with relative ease.
      
      Control dependencies are a different slice of the cake entirely.
      
      Just because we reached a branch during symbolic execution, it
      doesn't mean that that particular branch has any effect on whether the
      bug would've occured. This means that we can't simply rely on the bug
      path to gather control dependencies.
      
      In previous patches, LLVM's IDFCalculator, which works on a control flow
      graph rather than the ExplodedGraph was generalized to solve this issue.
      We use this information to heuristically guess that the value of a tracked
      expression depends greatly on it's control dependencies, and start
      tracking them as well.
      
      After plenty of evaluations this was seen as great idea, but still
      lacking refinements (we should have different descriptions about a
      conditions value), hence it's off-by-default.
      
      Differential Revision: https://reviews.llvm.org/D62883
      
      llvm-svn: 365207
      258e5e45
    • Eugene Leviant's avatar
      Reverted r365188 due to alignment problems on i686-android · e91f86f0
      Eugene Leviant authored
      llvm-svn: 365206
      e91f86f0
    • Johan Vikstrom's avatar
      [clangd] Added highlighting for variable references (declrefs) · 8ca1c65c
      Johan Vikstrom authored
      Summary: Added highlighting for variable references using VisitDeclRefExpr.
      
      Reviewers: hokein, sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D64199
      
      llvm-svn: 365205
      8ca1c65c
    • Haojian Wu's avatar
      [clangd] Deduplicate clang-tidy diagnostic messages. · ee08036d
      Haojian Wu authored
      Summary:
      Clang-tidy checks may emit duplicated messages (clang-tidy tool
      deduplicate them in its custom diagnostic consumer), and we may show
      multiple duplicated diagnostics in the UI, which is really bad.
      
      This patch makes clangd do the deduplication, and revert the change
      rL363889.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D64127
      
      llvm-svn: 365204
      ee08036d
    • Graham Hunter's avatar
      Scalable Vector IR Type with further LTO fixes · 957c40db
      Graham Hunter authored
      Reintroduces the scalable vector IR type from D32530, after it was reverted
      a couple of times due to increasing chromium LTO build times. This latest
      incarnation removes the walk over aggregate types from the verifier entirely,
      in favor of rejecting scalable vectors in the isValidElementType methods in
      ArrayType and StructType. This removes the 70% degradation observed with
      the second repro tarball from PR42210.
      
      Reviewers: thakis, hans, rengolin, sdesmalen
      
      Reviewed By: sdesmalen
      
      Differential Revision: https://reviews.llvm.org/D64079
      
      llvm-svn: 365203
      957c40db
    • Robert Lougher's avatar
      This reverts r365061 and r365062 (test update) · 9dcfbbae
      Robert Lougher authored
      Revision r365061 changed a skip of debug instructions for a skip
      of meta instructions. This is not safe, as IMPLICIT_DEF is classed
      as a meta instruction.
      
      llvm-svn: 365202
      9dcfbbae
    • Sam Elliott's avatar
      [RISCV] Support @llvm.readcyclecounter() Intrinsic · b2c9eed0
      Sam Elliott authored
      On RISC-V, the `cycle` CSR holds a 64-bit count of the number of clock
      cycles executed by the core, from an arbitrary point in the past. This
      matches the intended semantics of `@llvm.readcyclecounter()`, which we
      currently leave to the default lowering (to the constant 0).
      
      With this patch, we will now correctly lower this intrinsic to the
      intended semantics, using the user-space instruction `rdcycle`. On
      64-bit targets, we can directly lower to this instruction.
      
      On 32-bit targets, we need to do more, as `rdcycle` only returns the low
      32-bits of the `cycle` CSR. In this case, we perform a custom lowering,
      based on the PowerPC lowering, using `rdcycleh` to obtain the high
      32-bits of the `cycle` CSR. This custom lowering inserts a new basic
      block which detects overflow in the high 32-bits of the `cycle` CSR
      during reading (because multiple instructions are required to read). The
      emitted assembly matches the suggested assembly in the RISC-V
      specification.
      
      Differential Revision: https://reviews.llvm.org/D64125
      
      llvm-svn: 365201
      b2c9eed0
    • Nico Weber's avatar
      lld, llvm-dlltool, llvm-lib: Use getAsString() instead of getSpelling() for printing unknown args · a7802763
      Nico Weber authored
      Since OPT_UNKNOWN args never have any values and consist only of
      spelling (and are never aliased), this doesn't make any difference in
      practice, but it's more consistent with Arg's guidance to use
      getAsString() for diagnostics, and it matches what clang does.
      
      Also tweak two tests to use an unknown option that contains '=' for
      additional coverage while here. (The new tests pass fine with the old
      code too though.)
      
      llvm-svn: 365200
      a7802763
    • Robert Lougher's avatar
      Revert r365198 as this accidentally commited something that · 2478b620
      Robert Lougher authored
      should not have been added.
      
      llvm-svn: 365199
      2478b620
    • Robert Lougher's avatar
      This reverts r365061 and r365062 (test update) · 3bea2b15
      Robert Lougher authored
      Revision r365061 changed a skip of debug instructions for a skip
      of meta instructions. This is not safe, as IMPLICIT_DEF is classed
      as a meta instruction.
      
      llvm-svn: 365198
      3bea2b15
    • Kristof Umann's avatar
      [analyzer][IDF] Add a control dependency calculator + a new debug checker · 5e17ee1e
      Kristof Umann authored
      I intend to improve the analyzer's bug reports by tracking condition
      expressions.
      
      01 bool b = messyComputation();
      02 int i = 0;
      03 if (b) // control dependency of the bug site, let's explain why we assume val
      04        // to be true
      05   10 / i; // warn: division by zero
      
      I'll detail this heuristic in the followup patch, strictly related to this one
      however:
      
      * Create the new ControlDependencyCalculator class that uses llvm::IDFCalculator
        to (lazily) calculate control dependencies for Clang's CFG.
      * A new debug checker debug.DumpControlDependencies is added for lit tests
      * Add unittests
      
      Differential Revision: https://reviews.llvm.org/D62619
      
      llvm-svn: 365197
      5e17ee1e
    • Sam Elliott's avatar
      [RISCV][NFC] Replace hard-coded CSR duplication with symbolic references · 6884d5e0
      Sam Elliott authored
      Reviewers: asb, lenary
      
      Reviewed By: asb, lenary
      
      Subscribers: MaskRay, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64139
      
      Patch by James Clarke (jrtc27)
      
      llvm-svn: 365195
      6884d5e0
    • Simon Pilgrim's avatar
      Fix MSVC/cppcheck Use::Next isn't initialized warning. NFCI. · 6af0891f
      Simon Pilgrim authored
      llvm-svn: 365194
      6af0891f
    • Eugene Leviant's avatar
      [llvm-objcopy] Allow strip symtab from executables and DSOs · 194f16b3
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D61672
      
      llvm-svn: 365193
      194f16b3
    • Thomas Preud'homme's avatar
      [FileCheck] Fix comment in parseNumericVariableUse · 41f2bea6
      Thomas Preud'homme authored
      Summary:
      Comment explaining the interaction between parsing of numeric variable
      definition and uses in parseNumericVariableUse is stale since it
      suggests both use and definition parsing is done in the same function.
      This was the case in a previous version of the patch committed as
      71d3f227 but is no longer the case. This
      patch updates the comment accordingly.
      
      Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
      
      Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64227
      
      llvm-svn: 365192
      41f2bea6
    • Thomas Preud'homme's avatar
      [FileCheck] Factor some parsing checks out · 28196a5d
      Thomas Preud'homme authored
      Summary:
      Both callers of parseNumericVariableDefinition() perform the same extra
      check that no character is found after the variable name. This patch
      factors out this check into parseNumericVariableDefinition().
      
      Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
      
      Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64226
      
      llvm-svn: 365191
      28196a5d
    • Thomas Preud'homme's avatar
      [FileCheck] Add missing final dot in comment · a188ad26
      Thomas Preud'homme authored
      llvm-svn: 365190
      a188ad26
    • Endre Fulop's avatar
      [NFC] Test commit access · 3078b511
      Endre Fulop authored
      llvm-svn: 365189
      3078b511