1. Feb 12, 2021
    • Adrian Prantl's avatar
      llvm-dwarfdump: fix the counting when printing DW_OP_entry_value · 97dbab87
      Adrian Prantl authored
      The block size is in bytes, and not number of operands.
      
      Differential Revision: https://reviews.llvm.org/D96472
      97dbab87
    • Snehasish Kumar's avatar
      [CodeGen] Basic block sections should take precendence over splitting. · d079dbc5
      Snehasish Kumar authored
      The use of basic block sections should take precedence over the machine
      function splitting pass. Since they use the same underlying mechanism
      they are kept exclusive. Updated the tests to check that split machine
      functions is overridden by all flavours of basic block sections.
      
      Differential Revision: https://reviews.llvm.org/D96392
      d079dbc5
    • Eric Schweitz's avatar
      [flang][fir] Update the kind mapping class. · 4dc87d10
      Eric Schweitz authored
      The kind mapper provides a portable mechanism to map Fortran type KIND values
      independent of the front-end to their corresponding MLIR and LLVM types.
      
      Differential Revision: https://reviews.llvm.org/D96362
      4dc87d10
    • Jianzhou Zhao's avatar
      [dfsan] Add origin chain utils · 2d9c6e10
      Jianzhou Zhao authored
      This is a part of https://reviews.llvm.org/D95835.
      
      The design is based on MSan origin chains.
      
      An 4-byte origin is a hash of an origin chain. An origin chain is a
      pair of a stack hash id and a hash to its previous origin chain. 0 means
      no previous origin chains exist. We limit the length of a chain to be
      16. With origin_history_size = 0, the limit is removed.
      
      The change does not have any test cases yet. The following change
      will be adding test cases when the APIs are used.
      
      Reviewed-by: morehouse
      
      Differential Revision: https://reviews.llvm.org/D96160
      2d9c6e10
    • Matt Arsenault's avatar
      AMDGPU: Restrict soft clause bundling at half of the available regs · e3c6fa36
      Matt Arsenault authored
      Fixes a testcase that was overcommitting large register tuples to a
      bundle, which the register allocator could not possibly satisfy.  This
      was producing a bundle which used nearly all of the available SGPRs
      with a series of 16-dword loads (not all of which are freely available
      to use).
      
      This is a quick hack for some deeper issues with how the clause
      bundler tracks register pressure.
      
      Overall the pressure tracking used here doesn't make sense and is too
      imprecise for what it needs to avoid the allocator failing. The
      pressure estimate does not account for the alignment requirements of
      large SGPR tuples, so this was really underestimating the pressure
      impact. This also ignores the impact of the extended live range of the
      use registers after the bundle is introduced. Additionally, it didn't
      account for some wide tuples not being available due to reserved
      registers.
      
      This regresses a few cases. These end up introducing more
      spilling. This is also a function of the global pressure being used in
      the decision to bundle, not the local pressure impact of the bundle
      itself.
      e3c6fa36
    • peter klausler's avatar
      [flang] Improve "Error reading module file" error message · 0bfa4ac6
      peter klausler authored
      Instead of using a message attachment with further details,
      emit the details as part of a single message.
      
      Differential Revision: https://reviews.llvm.org/D96465
      0bfa4ac6
    • Sam Clegg's avatar
      [lld][WebAssembly] Delay the merging of data section when dynamic linking · 70f3c6e9
      Sam Clegg authored
      With dynamic linking we have the current limitation that there can be
      only a single active data segment (since we use __memory_base as the
      load address and we can't do arithmetic in constant expresions).
      
      This change delays the merging of active segments until a little later
      in the linking process which means that the grouping of data by section,
      and the magic __start/__end symbols work as expected under dynamic
      linking.
      
      Differential Revision: https://reviews.llvm.org/D96453
      70f3c6e9
    • Nick Desaulniers's avatar
      [clang][Arm] Fix handling of -Wa,-implicit-it= · a680bc3a
      Nick Desaulniers authored
      Similiar to D95872, this flag can be set for the assembler directly.
      Move validation code into a reusable helper function.
      
      Link: https://bugs.llvm.org/show_bug.cgi?id=49023
      Link: https://github.com/ClangBuiltLinux/linux/issues/1270
      
      
      Reported-by: default avatarArnd Bergmann <arnd@kernel.org>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      
      Reviewed By: DavidSpickett
      
      Differential Revision: https://reviews.llvm.org/D96285
      a680bc3a
    • Philip Reames's avatar
      [tests] Precommit tests for D96440 · 81c51891
      Philip Reames authored
      81c51891
    • Sanjay Patel's avatar
      6ef84730
    • Yonghong Song's avatar
      BPF: Add LLVMAnalysis in CMakefile LINK_COMPONENTS · 74975d35
      Yonghong Song authored
      buildbot reported a build error like below:
        BPFTargetMachine.cpp:(.text._ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev
          [_ZN4llvm19TargetTransformInfo5ModelINS_10BPFTTIImplEED2Ev]+0x14):
          undefined reference to `llvm::TargetTransformInfo::Concept::~Concept()'
        lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFTargetMachine.cpp.o:
          In function `llvm::TargetTransformInfo::Model<llvm::BPFTTIImpl>::~Model()':
      
      Commit a260ae71 ("BPF: Implement TTI.IntImmCost() properly")
      added TargetTransformInfo to BPF, which requires LLVMAnalysis
      dependence. In certain cmake configurations, lacking explicit
      LLVMAnalysis dependency may cause compilation error.
      Similar to other targets, this patch added LLVMAnalysis
      in CMakefile LINK_COMPONENTS explicitly.
      74975d35
    • Michael Kruse's avatar
      Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache" · 606aa622
      Michael Kruse authored
      This reverts commit b7d870ea and the
      subsequent fix "[Polly] Fix build after AssumptionCache change (D96168)"
      (commit e6810cab).
      
      It caused indeterminism in the output, such that e.g. the
      polly-x86_64-linux buildbot failed accasionally.
      606aa622
    • Mark de Wever's avatar
      [libc++][format] Enable format_error on older compilers. · f8772da8
      Mark de Wever authored
      It seems like modifying the header doesn't cause libc++ to be rebuild.
      So the breakage of the previous commit didn't happen on my system.
      
      This should fix the build of https://buildkite.com/mlir/mlir-core
      f8772da8
    • Leandro Vaz's avatar
      [flang] Fix typo in FlangConfig.cmake.in. · 204360fd
      Leandro Vaz authored
      `find_package(Flang)` does not work as there is a missing `@` in the
      FlangConfig.cmake.in file. This patch fixes the issue.
      
      Reviewed By: thopre
      
      Differential Revision: https://reviews.llvm.org/D96484
      204360fd
    • Mark de Wever's avatar
      [libc++][format] Improve Add basic_format_parse_context. · af83e89a
      Mark de Wever authored
      Add an additional guard to prevent building on older clang versions.
      
      This should fix the build of https://buildkite.com/mlir/mlir-core
      af83e89a
    • Fangrui Song's avatar
      0dc6122d
    • David Green's avatar
      [ARM] Single source vmovnt tests. NFC · 0f60ed12
      David Green authored
      0f60ed12
    • Jay Foad's avatar
      [AMDGPU] Better selection of base offset when merging DS reads/writes · 23db2d36
      Jay Foad authored
      When merging a pair of DS reads or writes needs to materialize the base
      offset in a vgpr, choose a value that is aligned to as high a power of
      two as possible. This maximises the chance that different pairs can use
      the same base offset, in which case the base offset registers can be
      commoned up by MachineCSE.
      
      Differential Revision: https://reviews.llvm.org/D96421
      23db2d36
    • Craig Topper's avatar
      [TargetLowering][RISCV][AArch64][PowerPC] Enable BuildUDIV/BuildSDIV on... · 5744502a
      Craig Topper authored
      [TargetLowering][RISCV][AArch64][PowerPC] Enable BuildUDIV/BuildSDIV on illegal types before type legalization if we can find a larger legal type that supports MUL.
      
      If we wait until the type is legalized, we'll lose information
      about the orginal type and need to use larger magic constants.
      This gets especially bad on RISCV64 where i64 is the only legal
      type.
      
      I've limited this to simple scalar types so it only works for
      i8/i16/i32 which are most likely to occur. For more odd types
      we might want to do a small promotion to a type where MULH is legal
      instead.
      
      Unfortunately, this does prevent some urem/srem+seteq matching since
      that still require legal types.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D96210
      5744502a
    • Fangrui Song's avatar
      [ELF] Resolve defined symbols before undefined symbols · 0557b1bd
      Fangrui Song authored
      When parsing an object file, LLD interleaves undefined symbol resolution (which
      may recursively fetch other lazy objects) with defined symbol resolution.
      
      This may lead to surprising results, e.g. if an object file defines currently
      undefined symbols and references another lazy symbol, we may interleave defined
      symbols with the lazy fetch, potentially leading to the defined symbols
      resolving to different files.
      
      As an example, if both `a.a(a.o)` and `a.a(b.o)` define `foo` (not in COMDAT
      group, or in different COMDAT groups) and `__profd_foo` (in COMDAT group
      `__profd_foo`).  LLD may resolve `foo` to `a.a(a.o)` and `__profd_foo` to
      `b.a(b.o)`, i.e. different files.
      
      ```
      parse ArchiveFile a.a
        entry fetches a.a(a.o)
        parse ObjectFile a.o
          define entry
          define foo
          reference b
          b fetches a.a(b.o)
          parse ObjectFile b.o
            define prevailing __profd_foo
          define (ignored) non-prevailing __profd_foo
      ```
      
      Assuming a set of interconnected symbols are defined all or none in several lazy
      objects. Arguably making them resolve to the same file is preferable than making
      them resolve to different files (some are lazy objects).
      
      The main argument favoring the new behavior is the stability. The relative order
      between a defined symbol and an undefined symbol does not change the symbol
      resolution behavior.  Only the relative order between two undefined symbols can
      affect fetching behaviors.
      
      ---
      
      The real world case is reduced from a Fuchsia PGO usage: `a.a(a.o)` has a
      constructor within COMDAT group C5 while `a.a(b.o)` has a constructor within
      COMDAT group C2. Because they use different group signatures, they are not
      de-duplicated. It is not entirely whether Clang behavior is entirely conforming.
      
      LLD selects the PGO counter section (`__profd_*`) from `a.a(b.o)` and the
      constructor section from `a.a(a.o)`. The `__profd_*` is a SHF_LINK_ORDER section
      linking to its own non-prevailing constructor section, so LLD errors
      `sh_link points to discarded section`. This patch fixes the error.
      
      Differential Revision: https://reviews.llvm.org/D95985
      0557b1bd
    • Nico Weber's avatar
      [gn build] port ed98676f · 18d38b24
      Nico Weber authored
      18d38b24
    • Stella Stamenova's avatar
      Support multi-configuration generators correctly in several config files · ed98676f
      Stella Stamenova authored
      Multi-configuration generators (such as Visual Studio and Xcode) allow the specification of a build flavor at build time instead of config time, so the lit configuration files need to support that - and they do for the most part. There are several places that had one of two issues (or both!):
      
      1) Paths had %(build_mode)s set up, but then not configured, resulting in values that would not work correctly e.g. D:/llvm-build/%(build_mode)s/bin/dsymutil.exe
      2) Paths did not have %(build_mode)s set up, but instead contained $(Configuration) (which is the value for Visual Studio at configuration time, for Xcode they would have had the equivalent) e.g. "D:/llvm-build/$(Configuration)/lib".
      
      This seems to indicate that we still have a lot of fragility in the configurations, but also that a number of these paths are never used (at least on Windows) since the errors appear to have been there a while.
      
      This patch fixes the configurations and it has been tested with Ninja and Visual Studio to generate the correct paths. We should consider removing some of these settings altogether.
      
      Reviewed By: JDevlieghere, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D96427
      ed98676f
    • Adhemerval Zanella's avatar
      [sanitizer] Fix suffix-log-path_test.c on arm-linux-gnu · 88d1724d
      Adhemerval Zanella authored
      The recent suffix-log-path_test.c checks for a full stacktrace and
      since on some arm-linux-gnu configuration the slow unwinder is used
      on default (when the compiler emits thumb code as default), it
      requires -funwind-tables on tests.
      
      It also seems to fix the issues disable by d025df3c.
      
      Reviewed By: ostannard
      
      Differential Revision: https://reviews.llvm.org/D96337
      88d1724d
    • Florian Hahn's avatar
      [LV] Add tests showing suboptimal vectorization for narrow types. · d5387ec2
      Florian Hahn authored
      This patch adds additional test cases showing missing/sub-optimal
      vectorization for loops which contain small and wider memory ops on
      AArch64.
      d5387ec2
    • Sourabh Singh Tomar's avatar
      [flang] Remove `LINK_WITH_FIR` cmake switch · 6a7deff5
      Sourabh Singh Tomar authored
      Most components required for this are already there.
      
      Build and Testing clean.
      ninja check-flang
      
      Reviewed By: clementval, tskeith
      
      Differential Revision: https://reviews.llvm.org/D96411
      6a7deff5
    • Craig Topper's avatar
      [RISCV] Add support loads, stores, and splats of vXi1 fixed vectors. · 033b1bd1
      Craig Topper authored
      This refines how we determine which masks types are legal and adds
      support for loads, stores, and all ones/zeros splats.
      
      I left a fixme in store handling where I think we need to zero
      extra bits if the type isn't a multiple of a byte. If I remember
      right from X86 there was some case we could have a store of a
      1, 2, or 4 bit mask and have a scalar zextload that then expected the
      bits to be 0. Its tricky to zero the bits with RVV. We need to do
      something like round VL up, zero a register, lower the VL back down,
      then do a tail undisturbed move into the zero register. Another
      option might be to generate a mask of 1/2/4 bits set with a VL of 8
      and use that to mask off the bits.
      
      Reviewed By: frasercrmck
      
      Differential Revision: https://reviews.llvm.org/D96468
      033b1bd1
    • Simon Pilgrim's avatar
      [DAG] foldLogicOfSetCCs - Generalize and/or (setcc X, CMax, ne), (setcc X, CMin, ne/eq) fold. NFCI. · 5beebf9c
      Simon Pilgrim authored
      Prep work to add support for non-uniform vectors - replace APInt values with using the SDValue ops directly.
      5beebf9c
    • Mark de Wever's avatar
      [libc++][format] Add basic_format_parse_context. · 38ddeade
      Mark de Wever authored
      Implements parts of:
      - P0645 Text Formatting
      
      Depends on D92214
      
      Reland with changes:
      The format header will only be compiled if the compiler used has support
      for concepts. This should fix the issues with the initial version.
      
      Differential Revision: https://reviews.llvm.org/D93166
      38ddeade
    • Nico Weber's avatar
      [gn build] Port 7e3b9aba · 1739e7ed
      Nico Weber authored
      1739e7ed
    • clementval's avatar
      Revert "[flang][fir][NFC] Move BoxType to TableGen type definition" · 661f9e2a
      clementval authored
      This reverts commit d96bb48f.
      661f9e2a
    • Yonghong Song's avatar
      BPF: Implement TTI.IntImmCost() properly · a260ae71
      Yonghong Song authored
      This patch implemented TTI.IntImmCost() properly.
      Each BPF insn has 32bit immediate space, so for any immediate
      which can be represented as 32bit signed int, the cost
      is technically free. If an int cannot be presented as
      a 32bit signed int, a ld_imm64 instruction is needed
      and a TCC_Basic is returned.
      
      This change is motivated when we observed that
      several bpf selftests failed with latest llvm trunk, e.g.,
        #10/16 strobemeta.o:FAIL
        #10/17 strobemeta_nounroll1.o:FAIL
        #10/18 strobemeta_nounroll2.o:FAIL
        #10/19 strobemeta_subprogs.o:FAIL
        #96 snprintf_btf:FAIL
      
      The reason of the failure is due to that
      SpeculateAroundPHIsPass did aggressive transformation
      which alters control flow for which currently verifer
      cannot handle well. In llvm12, SpeculateAroundPHIsPass
      is not called.
      
      SpeculateAroundPHIsPass relied on TTI.getIntImmCost()
      and TTI.getIntImmCostInst() for profitability
      analysis. This patch implemented TTI.getIntImmCost()
      properly for BPF backend which also prevented
      transformation which caused the above test failures.
      
      Differential Revision: https://reviews.llvm.org/D96448
      a260ae71
    • Alex Hoppen's avatar
      [Timer] On macOS count number of executed instructions · 7e3b9aba
      Alex Hoppen authored
      In addition to wall time etc. this should allow us to get less noisy
      values for time measurements.
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D96049
      7e3b9aba
    • Valentin Clement's avatar
      [flang][fir][NFC] Move BoxType to TableGen type definition · d96bb48f
      Valentin Clement authored
      This patch is a follow up of D96422 and move BoxType to TableGen.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D96476
      d96bb48f
    • Raphael Isemann's avatar
      [lldb] Fix that running a top level expression without a process fails with a cryptic error · 71536fd0
      Raphael Isemann authored
      Right now when running `expr --top-level -- void foo() {}`, LLDB just prints a cryptic
      `error: Couldn't find $__lldb_expr() in the module` error. The reason for that is
      that if we don't have a running process, we try to set our execution policy to always use the
      IR interpreter (ExecutionPolicyNever) which works even without a process. However
      that code didn't consider the special ExecutionPolicyTopLevel which we use for
      top-level expressions. By changing the execution policy to ExecutionPolicyNever,
      LLDB thinks we're actually trying to interpret a normal expression inside our
      `$__lldb_expr` function and then fails when looking for it.
      
      This just adds an exception for top-level expressions to that code and a bunch of tests.
      
      Reviewed By: shafik
      
      Differential Revision: https://reviews.llvm.org/D91723
      71536fd0
  2. Feb 11, 2021