1. Dec 06, 2019
  2. Dec 05, 2019
    • Sanjay Patel's avatar
      [InstCombine] add FMF guard to builder in fptrunc transform; NFC · 51e420c2
      Sanjay Patel authored
      This makes no difference currently because we don't apply FMF
      to FP casts, but that may change.
      
      This could also be a place to add a fold for select with fptrunc,
      so it will make that patch easier/smaller.
      51e420c2
    • Jeremy Morse's avatar
      [DebugInfo] Don't create multiple DBG_VALUEs when sinking · 30e8f80f
      Jeremy Morse authored
      This patch addresses a performance problem reported in PR43855, and
      present in the reapplication in in 001574938e5. It turns out that
      MachineSink will (often) move instructions to the first block that
      post-dominates the current block, and then try to sink further. This
      means if we have a lot of conditionals, we can needlessly create large
      numbers of DBG_VALUEs, one in each block the sunk instruction passes
      through.
      
      To fix this, rather than immediately sinking DBG_VALUEs, record them in
      a pass structure. When sinking is complete and instructions won't be
      sunk any further, new DBG_VALUEs are added, avoiding lots of
      intermediate DBG_VALUE $noregs being created.
      
      Differential revision: https://reviews.llvm.org/D70676
      30e8f80f
    • Jeremy Morse's avatar
      [DebugInfo] Don't reorder DBG_VALUEs when sunk · e4cdd626
      Jeremy Morse authored
      Fix part of PR43855, resolving a problem that comes from the reapplication
      in 001574938e5. If we have two DBG_VALUE insts in a block that specify
      the location of the same variable, for example:
      
         %0 = someinst
         DBG_VALUE %0, !123, !DIExpression()
         %1 = anotherinst
         DBG_VALUE %1, !123, !DIExpression()
      
      if %0 were to sink, the corresponding DBG_VALUE would sink too, past the
      next DBG_VALUE, effectively re-ordering assignments. To fix this, I've
      added a SeenDbgVars set recording what variable locations have been seen in
      a block already (working bottom up), and now flag DBG_VALUEs that would
      pass a later DBG_VALUE for the same variable.
      
      NB, this only works for repeated DBG_VALUEs in the same basic block, the
      general case involving control flow is much harder, which I've written
      up in PR44117.
      
      Differential revision: https://reviews.llvm.org/D70672
      e4cdd626
    • Jeremy Morse's avatar
      [DebugInfo] Re-apply two patches to MachineSink · fca41001
      Jeremy Morse authored
      These were:
       * D58386 / f5e1b718 / reverted in d382a8a7
       * D58238 / ee50590e / reverted in a8db456b
      
      Of which the latter has a performance regression tracked in PR43855,
      fixed by D70672 / D70676, which will be committed atomically with this
      reapplication.
      
      Contains a minor difference to account for a change in the IsCopyInstr
      signature.
      fca41001
    • Sanjay Patel's avatar
      403bb33a
    • Alexey Bataev's avatar
    • Ilya Biryukov's avatar
      242649c1
    • Alexey Bataev's avatar
      [OPENMP50]Add support for if clause for simd part in master taskloop simd directive. · 853961f2
      Alexey Bataev authored
      According to OpenMP 5.0, the if clause can be applied to simd
      subdirective in the combined directives.
      853961f2
    • Danilo Carvalho Grael's avatar
      [AArch64][SVE] Integer reduction instructions pattern/intrinsics. · b29916ce
      Danilo Carvalho Grael authored
      Added pattern matching/intrinsics for the following SVE instructions:
      
      -- saddv, uaddv
      -- smaxv, sminv, umaxv, uminv
      -- orv, eorv, andv
      b29916ce
    • Haojian Wu's avatar
      [clangd] Simplify the code, NFC. · 01e5290b
      Haojian Wu authored
      AST.getASTContext().getSourceManager() => AST.getSourceManager().
      01e5290b
    • LLVM GN Syncbot's avatar
      gn build: Merge 7f93cb62 · 699427d7
      LLVM GN Syncbot authored
      699427d7
    • Sam Parker's avatar
      [ARM] Enable TypePromotion by default · 393dacac
      Sam Parker authored
      ARMCodeGenPrepare has already been generalized and renamed to
      TypePromotion. We've had it enabled and tested downstream for a
      while, so enable it by default.
      
      Differential Revision: https://reviews.llvm.org/D70998
      393dacac
    • Haojian Wu's avatar
      [AST] Traverse the class type loc inside the member type loc. · 7f93cb62
      Haojian Wu authored
      Summary:
      We are missing this currently.
      
      This would fix https://github.com/clangd/clangd/issues/216.
      
      Reviewers: ilya-biryukov
      
      Subscribers: mgorny, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70849
      7f93cb62
    • Raphael Isemann's avatar
      [lldb][NFC] Move Address and AddressRange functions out of Stream and let them take raw_ostream · 1462f5a4
      Raphael Isemann authored
      Summary:
      Yet another step on the long road towards getting rid of lldb's Stream class.
      
      We probably should just make this some kind of member of Address/AddressRange, but it seems quite often we just push
      in random integers in there and this is just about getting rid of Stream and not improving arbitrary APIs.
      
      I had to rename another `DumpAddress` function in FormatEntity that is dumping the content of an address to make Clang happy.
      
      Reviewers: labath
      
      Reviewed By: labath
      
      Subscribers: JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71052
      1462f5a4
    • Hans Wennborg's avatar
    • Roman Lebedev's avatar
    • Victor Lomuller's avatar
      [AST] Enable expression of OpenCL language address spaces an attribute · 11a9bae8
      Victor Lomuller authored
      
      
      Summary:
      Enable a way to set OpenCL language address space using attributes
      in addition to existing keywords.
      
      Signed-off-by: default avatarVictor Lomuller <victor@codeplay.com>
      
      Reviewers: aaron.ballman, Anastasia
      
      Subscribers: yaxunl, ebevhan, cfe-commits, Naghasan
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71005
      
      
      
      Signed-off-by: default avatarAlexey Bader <alexey.bader@intel.com>
      11a9bae8
    • Pavel Labath's avatar
      [lldb/DWARF] Switch to llvm debug_rnglists parser · f5767e28
      Pavel Labath authored
      Summary:
      Our rnglist support was working only for the trivial cases (one CU),
      because we only ever parsed one contribution out of the debug_rnglists
      section. This means we were never able to resolve range lists for the
      second and subsequent units (DW_FORM_sec_offset references came out
      blang, and DW_FORM_rnglistx references always used the ranges lists from
      the first unit).
      
      Since both llvm and lldb rnglist parsers are sufficiently
      self-contained, and operate similarly, we can fix this problem by
      switching to the llvm parser instead. Besides the changes which are due
      to variations in the interface, the main thing is that now the range
      list object is a member of the DWARFUnit, instead of the entire symbol
      file. This ensures that each unit can get it's own private set of range
      list indices, and is consistent with how llvm's DWARFUnit does it
      (overall, I've tried to structure the code the same way as the llvm
      version).
      
      I've also added a test case for the two unit scenario.
      
      Reviewers: JDevlieghere, aprantl, clayborg
      
      Subscribers: dblaikie, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71021
      f5767e28
    • Melanie Blower's avatar
      Reapply af57dbf1 "Add support for options -frounding-math,... · 7f9b5138
      Melanie Blower authored
              Reapply af57dbf1 "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
      
              Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048
              The original patch is modified to set the strictfp IR attribute
              explicitly in CodeGen instead of as a side effect of IRBuilder.
              In the 2nd attempt to reapply there was a windows lit test fail, the
              tests were fixed to use wildcard matching.
      
              Differential Revision: https://reviews.llvm.org/D62731
      7f9b5138
    • Pavel Labath's avatar
      [lldb/cpluspluslanguage] Add constructor substitutor · c16f0b18
      Pavel Labath authored
      Summary:
      This patch adds code which will substitute references to the full object
      constructors/destructors with their base object versions.
      
      Like all substitutions in this category, this operation is not really
      sound, but doing this in a more precise way allows us to get rid of a
      much larger hack -- matching function according to their demangled
      names, which effectively does the same thing, but also much more.
      
      This is a (very late) follow-up to D54074.
      
      Background: clang has an optimization which can eliminate full object
      structors completely, if they are found to be equivalent to their base
      object versions. It does this because it assumes they can be regenerated
      on demand in the compile unit that needs them (e.g., because they are
      declared inline). However, this doesn't work for the debugging scenario,
      where we don't have the structor bodies available -- we pretend all
      constructors are defined out-of-line as far as clang is concerned. This
      causes clang to emit references to the (nonexisting) full object
      structors during expression evaluation.
      
      Fun fact: This is not a problem on darwin, because the relevant
      optimization is disabled to work around a linker bug.
      
      Reviewers: teemperor, JDevlieghere
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D70721
      c16f0b18
    • Pavel Labath's avatar
      [llvm/DWARF] Return section offset from DWARFUnit::get{Loc,Rng}listOffset · 4ee76a92
      Pavel Labath authored
      Summary:
      Currently these function return the raw content of the appropriate table
      header, which means they are relative to the DW_AT_{loc,rng}list_base,
      and one has to relocate them in order to do anything.
      
      This changes the functions to perform the relocation themselves, which
      seems more clearer, particularly as they are sitting right next to the
      find{Rng,Loc}listFromOffset functions, but one *cannot* simply take the
      result of these functions and take pass them there.
      
      The only effect of this patch is to change what value is dumped for the
      DW_AT_ranges attribute, which I think is for the better, as previously
      the values appeared to point into thin air.
      
      (The main reason I am looking at this is because I was trying to
      implement equivalent functionality in lldb's DWARFUnit, and was stumped
      by this behavior.
      
      Reviewers: dblaikie, JDevlieghere, aprantl
      
      Subscribers: hiraditya, llvm-commits, SouraVX
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71006
      4ee76a92
    • Djordje Todorovic's avatar
    • Haojian Wu's avatar
      [clangd] More unittests for cross-file rename. · 158356b8
      Haojian Wu authored
      Summary:
      The previous unittests for cross-file rename was kind of weak. With this
      patch, we should have more test coverage, and it is easy to add more tests in
      the future.
      
      Reviewers: ilya-biryukov, kbobyrev
      
      Reviewed By: ilya-biryukov
      
      Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71050
      158356b8
    • David Stenberg's avatar
      [DebugInfo] Handle call site values for instructions before call bundle · 54682d87
      David Stenberg authored
      Summary:
      If a call is bundled then the code that looks for instructions that
      produce parameter values would break when reaching the call's bundle
      header, due to the `ifCall(/*AnyInBundle*/)` invocation returning true.
      
      It is not enough to simply ignore bundle headers in the `isCall()`
      invocation, as the bundle header may have defines of parameter registers
      due to the call, meaning that such registers would incorrectly be
      removed from the worklist. Therefore, do not look at bundle headers at
      all.
      
      Reviewers: djtodoro, NikolaPrica, aprantl, vsk
      
      Reviewed By: aprantl, vsk
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #debug-info, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71024
      54682d87
    • Lang Hames's avatar
    • Pavel Labath's avatar
      [lldb] Don't put compile unit name into the support file list and support DWARF5 line tables · 57f8a998
      Pavel Labath authored
      Summary:
      Lldb's "format-independent" debug info made use of the fact that DWARF
      (<=4) did not use the file index zero, and reused the support file index
      zero for storing the compile unit name.
      
      While this provided some convenience for DWARF<=4, it meant that the PDB
      plugin needed to artificially remap file indices in order to free up
      index 0. Furthermore, DWARF v5 make file index 0 legal, which meant that
      similar remapping would be needed in the dwarf plugin too.
      
      What this patch does instead is remove the requirement of having the
      compile unit name in the index 0. It is not that useful since the name
      can always be fetched from the CompileUnit object. Remapping code in the
      pdb plugin(s) has been removed or simplified.
      
      DWARF plugin has started inserting an empty FileSpec at index 0 to
      ensure the indices keep matching up (in case of DWARF<=4). For DWARF5,
      we insert the file 0 from the line table.
      
      I add a test to ensure we can correctly lookup line table entries
      referencing file 0, and in particular the case where the file 0 is also
      duplicated in another file entry, as this is how clang produces line
      tables in some circumstances (see pr44170). Though this is probably a
      bug in clang, this is not forbidden by DWARF, and lldb already has
      support for that in some (but not all) cases -- this adds a test for the
      code path which was not fixed in this patch.
      
      Reviewers: clayborg, JDevlieghere, jdoerfert
      
      Subscribers: aprantl, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D70954
      57f8a998
    • Cullen Rhodes's avatar
      [AArch64][SVE] Implement element count intrinsics · f0355bc4
      Cullen Rhodes authored
      Summary:
      Adds intrinsics for the following:
      
          * cntb
          * cnth
          * cntw
          * cntd
          * cntp
      
      Reviewers: sdesmalen, huntergr, dancgr, rengolin, efriedma, rovka
      
      Reviewed By: efriedma
      
      Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70967
      f0355bc4
    • Peter Smith's avatar
      [LLD][ELF][AArch64] .note.gnu.property sections should have alignment 8 · 784f5758
      Peter Smith authored
      The .note.gnu.property SHT_NOTE sections on AArch64 (a 64-bit target)
      should have alignment 8 to more closely match the binutils implementation
      where alignment is 4-bytes on 32-bit machines and 8-bytes on 64-bit
      machines.
      
      Previously LLD was using 4 for both 32-bit and 64-bit machines.
      
      Differential Revision: https://reviews.llvm.org/D70962
      784f5758
    • Djordje Todorovic's avatar
      Reland "[LiveDebugValues] Introduce entry values of unmodified params" · 4b4ede44
      Djordje Todorovic authored
      Relanding this after resolving the cause of the test failure.
      4b4ede44
    • Balázs Kéri's avatar
      [Checkers] Added support for freopen to StreamChecker. · 7eafde98
      Balázs Kéri authored
      Summary: Extend StreamChecker with a new evaluation function for API call 'freopen'.
      
      Reviewers: NoQ, baloghadamsoftware, Szelethus, martong
      
      Reviewed By: baloghadamsoftware, martong
      
      Subscribers: martong, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69948
      7eafde98
    • Peter Smith's avatar
      [LLD][ELF] Add support for PT_GNU_PROPERTY · 4d6c4cb4
      Peter Smith authored
      The PT_GNU_PROPERTY program header describes the location of the
      .note.gnu.property SHT_NOTES section. The linux kernel uses this program
      header to find the .note.gnu.property section rather than parsing.
      Executables that have properties that the kernel needs to act on that don't
      have the PT_GNU_PROPERTY program header will not boot.
      
      Differential Revision: https://reviews.llvm.org/D70961
      4d6c4cb4