1. Apr 28, 2020
    • Pavel Labath's avatar
      [lldb/unittest] Adjust CheckIPSupport function to avoid double-consume of llvm::Error · f07f2cee
      Pavel Labath authored
      The problem caught by clang-tidy and reported by Tobias Bosch.
      f07f2cee
    • Pavel Labath's avatar
      [lldb-vscode] A couple of small style fixes · 5cee8ddc
      Pavel Labath authored
      to make the code conform to llvm style better:
      - avoid use of auto where the type is not obivous
      - avoid StringRef::data where it is not needed
      
      No functional change intended.
      5cee8ddc
    • Rainer Orth's avatar
      [Flang][CMake] Add explicit libFortranCommon dependency for f18 etc. · 3119bdb5
      Rainer Orth authored
      When I tried Solaris builds with `-DBUILD_SHARED_LIBS=ON`, some commands failed
      to link:
      
        [ 94%] Linking CXX executable ../../../../bin/f18
        Undefined                       first referenced
         symbol                             in file
        Fortran::common::IntrinsicTypeDefaultKinds::set_sizeIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        Fortran::common::IntrinsicTypeDefaultKinds::set_subscriptIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        Fortran::common::EnumIndexToString[abi:cxx11](int, char const*) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        Fortran::common::IntrinsicTypeDefaultKinds::set_defaultIntegerKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        Fortran::common::IntrinsicTypeDefaultKinds::IntrinsicTypeDefaultKinds() CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        Fortran::common::IntrinsicTypeDefaultKinds::set_defaultRealKind(int) CMakeFiles/f18.dir/f18.cpp.o  (symbol belongs to implicit dependency /var/llvm/local-amd64-release-shared-gcc8-make/lib/libFortranCommon.so.11git)
        ld: fatal: symbol referencing errors
      
      This patch fixes this by adding explicit dependencies on `libFortranCommon`
      to the affected commands.
      
      Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
      `x86-64-pc-linux-gnu`.
      
      Differential Revision: https://reviews.llvm.org/D78761
      3119bdb5
    • KAWASHIMA Takahiro's avatar
      [gcov][test] Work around PR45673 - NFC · 89f6a237
      KAWASHIMA Takahiro authored
      Work around PR45673 until the test code is fixed.
      89f6a237
    • Sander de Smalen's avatar
      [SveEmitter] Add builtins for ternary ops (fmla, fmad, etc) · e1932ffb
      Sander de Smalen authored
      This patch adds builtins for:
      - svmad, svmla, svmls, svmsb
        svnmad, svnmla, svnmls, svnmsb
        svmla_lane, svmls_lane
      
      These builtins come in several flavours:
      - Merge into first source vector (`_m`)
      - False lanes are undef (`_x`)
      - False lanes are zeroed (`_z`)
      
      And can also have `_n` to indicate the last operand is a scalar.
      
      For example:
      
        svint32_t svmla[_n_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2, int32_t op3)
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D78960
      e1932ffb
    • Chen Zheng's avatar
      22fdbd01
    • Ng Zhi An's avatar
      [PowerPC] Fix downcast from nullptr for target streamer · 500b4ad5
      Ng Zhi An authored
      getTargetStreamer() might return null (e.g. when running inlined-strings.ll test),
      downcasting to a reference will be wrong. This is detectable with -fsanitize=null.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D78686
      500b4ad5
    • Chen Zheng's avatar
    • Alex Zinenko's avatar
      [mlir][flang] use OpBuilder& instead of Builder* in <Op>::build methods · bb1d976f
      Alex Zinenko authored
      As we start defining more complex Ops, we increasingly see the need for
      Ops-with-regions to be able to construct Ops within their regions in
      their ::build methods. However, these methods only have access to
      Builder, and not OpBuilder. Creating a local instance of OpBuilder
      inside ::build and using it fails to trigger the operation creation
      hooks in derived builders (e.g., ConversionPatternRewriter). In this
      case, we risk breaking the logic of the derived builder. At the same
      time, OpBuilder::create, which is by far the largest user of ::build
      already passes "this" as the first argument, so an OpBuilder instance is
      already available.
      
      Update all ::build methods in all Ops in MLIR and Flang to take
      "OpBuilder &" instead of "Builder *". Note the change from pointer and
      to reference to comply with the common style in MLIR, this also ensures
      all other users must change their ::build methods.
      
      Differential Revision: https://reviews.llvm.org/D78713
      bb1d976f
    • Ehsan Toosi's avatar
      Providing buffer assignment for MLIR · 5c352e69
      Ehsan Toosi authored
      We have provided a generic buffer assignment transformation ported from
      TensorFlow. This generic transformation pass automatically analyzes the values
      and their aliases (also in other blocks) and returns the valid positions for
      Alloc and Dealloc operations. To find these positions, the algorithm uses the
      block Dominator and Post-Dominator analyses. In our proposed algorithm, we have
      considered aliasing, liveness, nested regions, branches, conditional branches,
      critical edges, and independency to custom block terminators. This
      implementation doesn't support block loops. However, we have considered this in
      our design. For this purpose, it is only required to have a loop analysis to
      insert Alloc and Dealloc operations outside of these loops in some special
      cases.
      
      Differential Revision: https://reviews.llvm.org/D78484
      5c352e69
    • Hans Wennborg's avatar
      Revert f8990feb "[libclang] Install both libclang.a and libclang.so when... · f03b505e
      Hans Wennborg authored
      Revert f8990feb "[libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON"
      
      This broke builds configured with
      
      $ cmake -GNinja -DCMAKE_BUILD_TYPE=Release '-DLLVM_ENABLE_PROJECTS=clang' '-DLLVM_TARGETS_TO_BUILD=X86' -DLLVM_ENABLE_PIC=OFF ../llvm
      
      CMake Error at
      /b/s/w/ir/cache/builder/src/third_party/llvm/clang/tools/libclang/CMakeLists.txt:123
      (target_compile_definitions):
          target_compile_definitions called with non-compilable target type
      
      This reverts commit f8990feb.
      f03b505e
    • Gabor Marton's avatar
      [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls · 62e747f6
      Gabor Marton authored
      Summary:
      Currently we map function summaries to names (i.e. strings). We can
      associate more summaries with different signatures to one name, this way
      we support overloading. During a call event we check whether the
      signature of the summary matches the signature of the callee and we
      apply the summary only in that case.
      
      In this patch we change this mapping to associate a summary to a
      FunctionDecl. We do lookup operations when the summary map is
      initialized. We lookup the given name and we match the signature of the
      given summary against the lookup results. If the summary matches the
      FunctionDecl (got from the lookup result) then we add that to the
      summary map. During a call event we compare FunctionDecl pointers.
      Advantages of this new refactor:
      - Cleaner mapping and structure for the checker.
      - Possibly way more efficient handling of call events.
      - A summary is added only if that is relevant for the given TU.
      - We can get the concrete FunctionDecl by the time when we create the
        summary, this opens up possibilities of further sanity checks
        regarding the summary cases and argument constraints.
      - Opens up to future work when we'd like to store summaries from IR to a
        FunctionDecl (or from the Attributor results of the given
        FunctionDecl).
      
      Note, we cannot support old C functions without prototypes.
      
      Reviewers: NoQ, Szelethus, balazske, jdoerfert, sstefan1, uenoku
      
      Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, uenoku, ASDenysPetrov, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D77641
      62e747f6
    • Sam Parker's avatar
      [TTI] Add TargetCostKind argument to getUserCost · e9c9329a
      Sam Parker authored
      There are several different types of cost that TTI tries to provide
      explicit information for: throughput, latency, code size along with
      a vague 'intersection of code-size cost and execution cost'.
      
      The vectorizer is a keen user of RecipThroughput and there's at least
      'getInstructionThroughput' and 'getArithmeticInstrCost' designed to
      help with this cost. The latency cost has a single use and a single
      implementation. The intersection cost appears to cover most of the
      rest of the API.
      
      getUserCost is explicitly called from within TTI when the user has
      been explicit in wanting the code size (also only one use) as well
      as a few passes which are concerned with a mixture of size and/or
      a relative cost. In many cases these costs are closely related, such
      as when multiple instructions are required, but one evident diverging
      cost in this function is for div/rem.
      
      This patch adds an argument so that the cost required is explicit,
      so that we can make the important distinction when necessary.
      
      Differential Revision: https://reviews.llvm.org/D78635
      e9c9329a
    • serge-sans-paille's avatar
      Use components instead of libraries in Polly linkage step · e849e7a7
      serge-sans-paille authored
      As a side effect, this tests (and fix a bug) in the compiler extension handling
      of components.
      
      Differential Revision: https://reviews.llvm.org/D78358
      e849e7a7
    • Jonas Paulsson's avatar
      [SystemZ] Fix test case. · c84461ba
      Jonas Paulsson authored
      Remove bad kill flags fom load-and-test.mir as discovered by
      https://reviews.llvm.org/D78586: "[MachineVerifier] Add more checks for
      registers in live-in lists".
      
      Review: Ulrich Weigand
      c84461ba
    • Kazushi (Jam) Marukawa's avatar
      [VE] Update branch instructions · 3c80478d
      Kazushi (Jam) Marukawa authored
      Summary:
      Changing all mnemonic to match assembly instructions to simplify mnemonic
      naming rules. This time update all branch instructions.  This also change
      to use %s10 register consistently.
      
      Differential Revision: https://reviews.llvm.org/D78889
      3c80478d
    • Kazushi (Jam) Marukawa's avatar
      [VE] Support floating point immediate values · 0314e898
      Kazushi (Jam) Marukawa authored
      Summary:
      Add simm7fp/mimmfp to represent floating point immediate values.
      Also clean multiclasses to define floating point arithmetic instructions
      to handle simm7fp/mimmfp operands.  Also add several regression tests
      for new operands.
      
      Differential Revision: https://reviews.llvm.org/D78887
      0314e898
    • Chen Zheng's avatar
      [PowerPC] use inst-level fast-math-flags to drive MachineCombiner · 45d92806
      Chen Zheng authored
      Currently, on PowerPC target, it uses function scope UnsafeFPMath
      option to drive Machine Combiner pass.
      
      This is not accurate in two ways:
      1: the scope is not accurate. Machine Combiner pass only requires
         instruction-level flags instead of the function scope.
      2: the float point flag is not accurate. Machine Combiner pass
         only requires float point flags reassoc and nsz.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D78183
      45d92806
    • Haojian Wu's avatar
      Fix the -Wunused-variable warning. · b73290be
      Haojian Wu authored
      b73290be
    • Craig Topper's avatar
      [SelectionDAGBuilder] Use CallBase::isInlineAsm in a couple places. NFC · e13c141a
      Craig Topper authored
      These lines were just changed from using CallBase::getCalledValue
      to getCallledOperand. Go aheand change them to isInlineAsm.
      e13c141a
    • Craig Topper's avatar
      [IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand(). · a58b62b4
      Craig Topper authored
      This method has been commented as deprecated for a while. Remove
      it and replace all uses with the equivalent getCalledOperand().
      
      I also made a few cleanups in here. For example, to removes use
      of getElementType on a pointer when we could just use getFunctionType
      from the call.
      
      Differential Revision: https://reviews.llvm.org/D78882
      a58b62b4
    • Tony's avatar
      [AMDGPU] DWARF proposal review feedback · 756ba354
      Tony authored
      - Rename DW_OP_LLVM_offset_constu to DW_OP_LLVM_offset_uconst to
        matches DW_OP_plus_uconst.
      - Correct DW_OP_LLVM_call_ref to be DW_OP_call_ref.
      - Move proposed changes to a separate section to clarify that the
        introduction section is not part of the changes.
      - Fix formatting typos and add missing reference.
      - Clarify why DW_OP_LLVM_offset et al do not wrap on overflow.
      - Correct syntax of augmentation string.
      
      Differential Revision: https://reviews.llvm.org/D70523
      756ba354
    • Uday Bondhugula's avatar
      [MLIR] Introduce op trait PolyhedralScope · dd2c639c
      Uday Bondhugula authored
      Introduce op trait `PolyhedralScope` for ops to define a new scope for
      polyhedral optimization / affine dialect purposes, thus generalizing
      such scopes beyond FuncOp. Ops to which this trait is attached will
      define a new scope for the consideration of SSA values as valid symbols
      for the purposes of polyhedral analysis and optimization. Update methods
      that check for dim/symbol validity to work based on this trait.
      
      Differential Revision: https://reviews.llvm.org/D78863
      dd2c639c
    • Mircea Trofin's avatar
      011a07c0
    • Mircea Trofin's avatar
      [llvm][NFC] Use CallBase instead of Instruction in ProfileSummaryInfo · cb56e9b9
      Mircea Trofin authored
      Summary:
      getProfileCount requires the parameter be a valid CallBase, and its uses
      reflect that.
      
      Reviewers: dblaikie, craig.topper, wmi
      
      Subscribers: eraman, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78940
      cb56e9b9
    • Nico Weber's avatar
      Revert "[gn build] (manually) merge cd84bfb8" · cbb61831
      Nico Weber authored
      This reverts commit 825f583c.
      This reverts commit 45417ecb.
      
      cd84bfb8 was reverted in be884b79
      cbb61831
    • Kang Zhang's avatar
      [PowerPC] Fix the liveins for ppc-expand-isel pass · 4bb0a1cb
      Kang Zhang authored
      Summary:
      In the ppc-expand-isel pass, we use stepForward() to update the
      liveins, this function is not recommended, because it needs the
      accurate kill info.
      
      This patch uses the function computeAndAddLiveIns() to update the
      liveins, it's the recommended method and can fix the liveins bug for
      ppc-expand-isel pass..
      
      Reviewed By: efriedma, lkail
      
      Differential Revision: https://reviews.llvm.org/D78657
      4bb0a1cb
    • Saleem Abdulrasool's avatar
      Revert "build: use `find_package(Python3)` if available" · be884b79
      Saleem Abdulrasool authored
      This reverts commit cd84bfb8.  Although
      this passed the CI in phabricator, some of the bots are missing python3
      packages, revert it temporarily.
      be884b79
    • Nico Weber's avatar
      825f583c
    • Nico Weber's avatar
      [gn build] (manually) merge cd84bfb8 · 45417ecb
      Nico Weber authored
      45417ecb
    • Mehdi Amini's avatar
      Make MLIR Pass Timing output configurable through injection · f65a3f7c
      Mehdi Amini authored
      This makes it possible for the client to control where the pass timings will
      be printed.
      
      Differential Revision: https://reviews.llvm.org/D78891
      f65a3f7c
    • Saleem Abdulrasool's avatar
      build: use `find_package(Python3)` if available · cd84bfb8
      Saleem Abdulrasool authored
      This is primarily motivated by the desire to move from Python2 to
      Python3.  `PYTHON_EXECUTABLE` is ambiguous.  This explicitly identifies
      the python interpreter in use.  Since the LLVM build seems to be able to
      completed successfully with python3, use that across the build.  The old
      path aliases `PYTHON_EXECUTABLE` to be treated as Python3.
      cd84bfb8
    • Alexander Shaposhnikov's avatar
      [llvm-objcopy][MachO] Fix build · 29c6f5c7
      Alexander Shaposhnikov authored
      Some compilers are confused when the same name is used in different contexts.
      Rename the field Section to unbreak the build.
      (Caught by the buildbot http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/22374)
      29c6f5c7
    • Alexander Shaposhnikov's avatar
      [llvm-objcopy][MachO] Handle relocation entries where r_extern is zero · 0db3a5a9
      Alexander Shaposhnikov authored
      Fix handling of relocations with r_extern == 0.
      If r_extern == 0 then r_symbolnum is an index of a section rather than a symbol index.
      
      Patch by Seiya Nuta and Alexander Shaposhnikov.
      
      Test plan: make check-all
      
      Differential revision: https://reviews.llvm.org/D78946
      0db3a5a9
    • Eric Schweitz's avatar
      [flang] Upstream recent work on FIR to llvm-project. · bc034238
      Eric Schweitz authored
      Summary:
      
      Reviewers: DavidTruby, sscalpone, jeanPerier
      
      Subscribers: mgorny, aartbik, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D78835
      bc034238
    • Nick Desaulniers's avatar
      [X86] remove derived method w/ same impl as base · bc7f3240
      Nick Desaulniers authored
      Summary:
      While looking into issues with IfConverter, I noticed that
      X86InstrInfo::isUnpredicatedTerminator matched its overriden
      implementation in TargetInstrInfo::isUnpredicatedTerminator.
      
      Reviewers: craig.topper, hfinkel, MaskRay, echristo
      
      Reviewed By: MaskRay, echristo
      
      Subscribers: hiraditya, llvm-commits, srhines
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D62749
      bc7f3240
    • River Riddle's avatar
      [mlir][LLVMDebugTranslation] Only insert the location mapping after translation · 6fab33b2
      River Riddle authored
      This fixes an iteration invalidation bug when the map grows beyond capacity and the iterator for the location to translate becomes invalid.
      6fab33b2
    • Jonas Devlieghere's avatar
      [llvm/DebugInfo] Fix typo in DWARFTypeUnit ctor call · a4ccfd95
      Jonas Devlieghere authored
      We were passing the AppleObjCSection instead of the AddrSection. Maybe
      the API changed and this remained unnoticed because the types are the
      same, or maybe it's just a typo.
      a4ccfd95
    • Jonas Devlieghere's avatar
      [llvm/DebugInfo] Print DW_AT_ranges offset as part of verifier error. · bbaa639b
      Jonas Devlieghere authored
      Print the DW_AT_ranges offset as part of the verifier error, like we do
      for the DW_AT_stmt_list offset.
      bbaa639b
    • Christopher Tetreault's avatar
      [SVE][NFC] Use ScalableVectorType in CGBuiltin · da8918f2
      Christopher Tetreault authored
      Summary: * Upgrade some usages of VectorType to use ScalableVectorType
      
      Reviewers: efriedma, david-arm, fpetrogalli, kmclaughlin
      
      Reviewed By: efriedma
      
      Subscribers: tschuett, rkruppe, psnobl, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D78842
      da8918f2