1. Dec 11, 2019
  2. Dec 10, 2019
    • Kostya Kortchinsky's avatar
      [scudo][standalone] Define hasHardwareCRC32 for other archs · b36b1637
      Kostya Kortchinsky authored
      Summary:
      The function was only defined for x86 and arm families, which ends
      up being an issue for PPC in g3.
      
      Define the function, simply returning `false` for "other"
      architectures.
      
      Reviewers: hctim, pcc, cferris, eugenis, vitalybuka
      
      Subscribers: kristof.beyls, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71223
      b36b1637
    • Sanjay Patel's avatar
      [InstCombine] replace shuffle's insertelement operand if inserted scalar is not demanded · 396d18ae
      Sanjay Patel authored
      This pattern is noted as a regression from:
      D70246
      ...where we removed an over-aggressive shuffle simplification.
      
      SimplifyDemandedVectorElts fails to catch this case when the insert has multiple uses,
      so I'm proposing to pattern match the minimal sequence directly. This fold does not
      conflict with any of our current shuffle undef/poison semantics.
      
      Differential Revision: https://reviews.llvm.org/D71220
      396d18ae
    • Sanjay Patel's avatar
      [Docs] Improve SLP code snippet · a0c558ee
      Sanjay Patel authored
      New C code snippet is more viable for SLP vectorization in most architectures.
      
      Patch by: @lsandov1 (Leonardo Sandoval)
      
      Differential Revision: https://reviews.llvm.org/D70866
      a0c558ee
    • Guillaume Chatelet's avatar
      [Alignment][NFC] CreateMemSet use MaybeAlign · 1b2842bf
      Guillaume Chatelet authored
      Summary:
      This is patch is part of a series to introduce an Alignment type.
      See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
      See this patch for the introduction of the type: https://reviews.llvm.org/D64790
      
      Reviewers: courbet
      
      Subscribers: arsenm, jvesely, nhaehnle, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71213
      1b2842bf
    • Luís Marques's avatar
      [DWARF][RISCV] Test resolving of RISC-V relocations · 707e9707
      Luís Marques authored
      Summary: This patch adds an object file (in yaml format) with a synthetic
      .debug_info section which we use to test that the supported RISC-V relocations
      are properly resolved.
      
      Reviewers: asb, lenary, MaskRay
      Reviewed By: MaskRay
      Tags: #llvm
      Differential Revision: https://reviews.llvm.org/D70541
      707e9707
    • stozer's avatar
      Reapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty... · f2ba9397
      stozer authored
      basic blocks
      
      Originally applied in 72ce7599.
      
      Fixed a build failure caused by incorrect use of cast instead of
      dyn_cast.
      
      This reverts commit 8b0780f7.
      f2ba9397
    • Raphael Isemann's avatar
      [lldb] Actually enable wchar support in Editline when it is defined in the host config · 14f3d134
      Raphael Isemann authored
      Summary:
      Our Editline implementation in LLDB supports using the wchar interface of Editline which
      should improve handling of unicode input when using Editline. At the moment we essentially
      just ignore unicode input and echo the escaped unicode code point (`\U1234`) to the command line
      (which we then also incorrectly treat as multiple characters, so console navigation is also broken afterwards).
      
      This patch just adds the include to the host config file which already contains the LLDB_EDITLINE_USE_WCHAR
      define to enable the Editline support (we just never included it in the file before). With this we now actually
      echo back unicode characters on macOS and we no longer ignore unicode input. On Linux this doesn't
      seem to improve the echoing back of characters but at least it fixes that we ignore unicode input.
      
      Reviewers: labath
      
      Reviewed By: labath
      
      Subscribers: JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71251
      14f3d134
    • Sam Parker's avatar
      add test for previous commit · 06b0228e
      Sam Parker authored
      06b0228e
    • Sam Parker's avatar
      [TypePromotion] Query target register width · 933de407
      Sam Parker authored
      TargetLoweringInfo may report that an integer should be promoted, but
      it maybe provide a size that isn't natively supported by the target
      register file... So check this before trying to perform a promotion.
      
      This is to fix some chromium issues:
      https://bugs.chromium.org/p/chromium/issues/detail?id=1031978
      https://bugs.chromium.org/p/chromium/issues/detail?id=1031979
      
      Differential Revision: https://reviews.llvm.org/D71200
      933de407
    • Pavel Labath's avatar
      [lldb] Centralize type "desugaring" logic in ClangASTContext · f4827081
      Pavel Labath authored
      Summary:
      A *lot* of ClangASTContext functions contained repetitive code for
      "desugaring" certain kinds of clang types. This patch creates a utility
      function for performing this task.
      
      Right now it handles four types (auto, elaborated, paren and typedef),
      as these are the types that were handled everywhere. There are probably
      other kinds of types that could/should be added here too (TypeOf,
      decltype, ...), but I'm leaving that for a separate patch as doing that
      would not be NFC (though I'm pretty sure that adding them will not hurt,
      and it may in fact fix some bugs).
      
      In another patch I'd like to add "atomic" type to this list to properly
      display atomic structs.
      
      Since sometimes one may want to handle a certain kind of type specially
      (right now we have code which does that with typedefs), the Desugar
      function takes a "mask" argument, which can supress desugaring of
      certain kinds of types.
      
      Reviewers: teemperor, shafik
      
      Subscribers: jfb, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71212
      f4827081
    • Raphael Isemann's avatar
      [lldb][NFC] Make g_TotalSizeOfMetadata in ClangExternalASTSourceCommon.cpp static · e9895c61
      Raphael Isemann authored
      Clang was warning that this global should be static (which makes sense).
      e9895c61
    • Martin Storsjö's avatar
      [LLDB] [PECOFF] Make sure to set the address byte size in m_data after parsing headers · a0f72441
      Martin Storsjö authored
      If not set, the address byte size was implied to be the one of the
      host process.
      
      This allows reverting the functional change from 31087b2ae9154, since
      now PECOFF does the same as ELF and MachO wrt setting both byte order
      and address size on m_data within ParseHeader.
      
      Differential Revision: https://reviews.llvm.org/D71108
      a0f72441
    • Kiran Chandramohan's avatar
      [AArch64] Fix issues with large arrays on stack · 965ed1e9
      Kiran Chandramohan authored
      Summary:
      This patch fixes a few issues when large arrays are allocated on the
      stack. Currently, clang has inconsistent behaviour, for debug builds
      there is an assertion failure when the array size on stack is around 2GB
      but there is no assertion when the stack is around 8GB. For release
      builds there is no assertion, the compilation succeeds but generates
      incorrect code. The incorrect code generated is due to using
      int/unsigned int instead of their 64-bit counterparts. This patch,
      1) Removes the assertion in frame legality check.
      2) Converts int/unsigned int in some places to the 64-bit variants. This
      helps in generating correct code and removes the inconsistent behaviour.
      3) Adds a test which runs without optimisations.
      
      Reviewers: sdesmalen, efriedma, fhahn, aemerson
      
      Reviewed By: efriedma
      
      Subscribers: eli.friedman, fpetrogalli, kristof.beyls, hiraditya,
      llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70496
      965ed1e9
    • Nico Weber's avatar
      gn build: (manually) merge eb3e81f4 · b2508ce8
      Nico Weber authored
      b2508ce8
    • Jim Lin's avatar
      Only Remove implicit conversion for the target that support fp16 · 9c396637
      Jim Lin authored
      Remove implicit conversion that promotes half to double
      for the target that support fp16. If the target doesn't
      support fp16, fp16 will be converted to fp16 intrinsic.
      9c396637
    • Simon Tatham's avatar
      [TableGen] Permit dag operators to be unset. · 0e894ede
      Simon Tatham authored
      This is not a new semantic feature. The syntax `(? 1, 2, 3)` was
      disallowed by the parser in a dag //expression//, but there were
      already ways to sneak a `?` into the operator field of a dag
      //value//, e.g. by initializing it from a class template parameter
      which is then set to `?` by the instantiating `def`.
      
      This patch makes `?` in the operator slot syntactically legal, so it's
      now easy to construct dags with an unset operator. Also, the semantics
      of `!con` are relaxed so that it will allow a combination of set and
      unset operator fields in the dag nodes it's concatenating, with the
      restriction that all the operators that are //not// unset still have
      to agree with each other.
      
      Reviewers: hfinkel, nhaehnle
      
      Reviewed By: hfinkel, nhaehnle
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71195
      0e894ede
    • Cullen Rhodes's avatar
      [AArch64][SVE] Add wide compare immediate patterns · 1b9a608c
      Cullen Rhodes authored
      Summary:
      Recognize wide compares where the wide operand is a splat of a scalar
      value in the appropriate range and convert to the immediate variant of
      the instruction.
      
      Patch by Graham Hunter
      
      Reviewers: sdesmalen, efriedma, dancgr, rovka, rengolin
      
      Reviewed By: efriedma
      
      Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl,
      llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71009
      1b9a608c
    • Mikael Holmen's avatar
      [LegalizeTypes] Bugfixes for big-endian targets when handling BITCASTs · 4763267e
      Mikael Holmen authored
      Summary:
      This fixes PR44135.
      
      The special case when we promote a bitcast from a vector to an int
      needs special handling when we are on a big-endian target.
      
      Prior to this fix, for the added vec_to_int we see the following in the
      SelectionDAG printouts
      
      Type-legalized selection DAG: %bb.1 'foo:bb.1'
      SelectionDAG has 9 nodes:
        t0: ch = EntryToken
              t2: v8i16,ch = CopyFromReg t0, Register:v8i16 %0
            t17: v4i32 = bitcast t2
          t23: i32 = extract_vector_elt t17, Constant:i32<3>
        t8: ch,glue = CopyToReg t0, Register:i32 $r0, t23
        t9: ch = ARMISD::RET_FLAG t8, Register:i32 $r0, t8:1
      
      and I think here the extract_vector_elt is wrong and extracts the value
      from the wrong index.
      
      The program program should return the 32 bits made up of the elements at
      index 4 and 5 in the vec6 array, but with
      
          t23: i32 = extract_vector_elt t17, Constant:i32<3>
      
      as far as I can tell, we will extract values that originally didn't even
      exist in the vec6 vectore.
      
      If we would instead extract the element at index 2 we would get the wanted
      values.
      
      With this fix we insert a right shift after the bitcast in
      DAGTypeLegalizer::PromoteIntRes_BITCAST which then gives us
      
      Type-legalized selection DAG: %bb.1 'vec_to_int:bb.1'
      SelectionDAG has 9 nodes:
        t0: ch = EntryToken
              t2: v8i16,ch = CopyFromReg t0, Register:v8i16 %0
            t23: v4i32 = bitcast t2
          t27: i32 = extract_vector_elt t23, Constant:i32<2>
        t8: ch,glue = CopyToReg t0, Register:i32 $r0, t27
        t9: ch = ARMISD::RET_FLAG t8, Register:i32 $r0, t8:1
      
      So now we get
      
          t27: i32 = extract_vector_elt t23, Constant:i32<2>
      
      which is what we want.
      
      Similarly, the new int_to_vec testcase exposes a bug where we cast the other
      direction. Then we instead need to add a left shift before the bitcast on
      big-endian targets for the bits in the input integer to end up at the exptected
      place in the vector.
      
      Reviewers: bogner, spatel, craig.topper, t.p.northover, dmgreen, efriedma, SjoerdMeijer, samparker
      
      Reviewed By: efriedma
      
      Subscribers: eli.friedman, bjope, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D70942
      4763267e
    • Mikael Holmen's avatar
      Add testcases exposing PR44135 · 4d280d3a
      Mikael Holmen authored
      4d280d3a
    • Georgii Rymar's avatar
      [llvm-readelf/llvm-readobj] - Improved the error reporting in a few method related to versioning. · dac5ddb4
      Georgii Rymar authored
      I was investigating a change previously discussed that eliminates an excessive
      empty lines from the output when we report warnings and errors
      (https://reviews.llvm.org/D70826#inline-639055) and found
      that we need this refactoring or alike to achieve that.
      
      The problem is that some of our functions that finds symbol versions just
      fail instead of returning errors or printing warnings. Another problem
      is that they might print a warning on the same line with the regular output.
      In this patch I've splitted getting of the version information and dumping of it
      for GNU printVersionSymbolSection(). I had to change a few methods to return
      Error or Expected<> to do that properly.
      
      Differential revision: https://reviews.llvm.org/D71118
      dac5ddb4
    • Hans Wennborg's avatar
      Add more diff -b to roundtrip-compress.test · bfb53c55
      Hans Wennborg authored
      It was missing on the first test invocation. The flag is necessary to
      ignore line-ending differences on Windows.
      bfb53c55
    • Ilya Biryukov's avatar
      [clangd] Simplify code using findName. NFC · b63c35eb
      Ilya Biryukov authored
      `findName` was always used in conjuction with `spellingLocIfSpelled`.
      This patch replaces patterns of the form:
        spellingLocIfSpelled(findName(&ND), SM)
      
      With a new helper function:
        nameLocation(ND, SM)
      
      And removes `spellingLocIfSpelled` and `findName`. Both are never used
      anywhere else and the latter is an equivalent of `Decl::getLocation` if
      we ever need it again.
      b63c35eb
    • Georgii Rymar's avatar
      [llvm-readobj][test] - Move platform specific test cases and their inputs to separate folders. · dbf520f6
      Georgii Rymar authored
      This creates the next subfolders in the test directory:
      "COFF", "ELF", "MachO", "wasm".
      
      I've also removed platform specific prefixes, like "coff-*".
      One unused binary was removed as well: `Inputs/relocs.obj.elf-mips`
      
      Differential revision: https://reviews.llvm.org/D71203
      dbf520f6
    • Johannes Doerfert's avatar
      [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h · eb3e81f4
      Johannes Doerfert authored
      Summary:
      The new OpenMPConstants.h is a location for all OpenMP related constants
      (and helpers) to live.
      
      This patch moves the directives there (the enum OpenMPDirectiveKind) and
      rewires Clang to use the new location.
      
      Initially part of D69785.
      
      Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim
      
      Subscribers: jholewinski, ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69853
      eb3e81f4
    • Yonghong Song's avatar
      [BPF] Support to emit debugInfo for extern variables · 44481250
      Yonghong Song authored
      extern variable usage in BPF is different from traditional
      pure user space application. Recent discussion in linux bpf
      mailing list has two use cases where debug info types are
      required to use extern variables:
        - extern types are required to have a suitable interface
          in libbpf (bpf loader) to provide kernel config parameters
          to bpf programs.
          https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t
        - extern types are required so kernel bpf verifier can
          verify program which uses external functions more precisely.
          This will make later link with actual external function no
          need to reverify.
          https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed
      
      This patch added bpf support to consume such info into BTF,
      which can then be used by bpf loader. Function processFuncPrototypes()
      only adds extern function definitions into BTF. The functions
      with actual definition have been added to BTF in some other places.
      
      Differential Revision: https://reviews.llvm.org/D70697
      44481250
    • Jim Lin's avatar
      Remove implicit conversion that promotes half to other larger precision types... · cefac9df
      Jim Lin authored
      Remove implicit conversion that promotes half to other larger precision types for fp classification builtins
      
      Summary:
      It shouldn't promote half to double or any larger precision types for fp classification builtins.
      Because fp classification builtins would get incorrect result with promoted argument.
      For example, __builtin_isnormal with a subnormal half value should return false, but it is not.
      That the subnormal half value is promoted to a normal double value.
      
      Reviewers: aaron.ballman
      
      Reviewed By: aaron.ballman
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71049
      cefac9df
    • Francis Visoiu Mistrih's avatar
      [Remarks][Driver] Error on -foptimization-record-file with multiple -arch options · ae09dd86
      Francis Visoiu Mistrih authored
      This adds a check for the usage of -foptimization-record-file with
      multiple -arch options. This is not permitted since it would require us
      to rename the file requested by the user to avoid overwriting it for the
      second cc1 invocation.
      ae09dd86
    • Puyan Lotfi's avatar
      [NFCi][llvm][MIRVRegNamerUtils] Making some code cleanup and stylistic changes. · 479e3b85
      Puyan Lotfi authored
      Making some changes to MIRVRegNamerUtils.cpp to use some more modern c++
      features as well as some changes to generally make the code more concise
      and more understandable.
      
      I make this an NFCi because in one case I drop the whole
      "if (!MO->isDef()) MO->setIsKill(false);" thing that was added in the
      original implementation, generally because I don't think this is really
      semantically sound. I also changed up the implementation of
      VRegRenamer::createVirtualRegisterWithLowerName somewhat because I am
      now lower-casing the name unconditionally because I confirmed that that
      was in fact aditya_nandakumar@apple.com's intent.
      
      In all other cases, behavior should not be changed.
      
      Differential Revision: https://reviews.llvm.org/D71182
      479e3b85