Skip to content
  1. Jul 28, 2020
    • Bruno Ricci's avatar
    • Serge Pavlov's avatar
      [Support] Add file lock/unlock functions · 53673699
      Serge Pavlov authored
      This is recommit of f51bc4fb, reverted in 8577595e, because
      the function `flock` is not available on Solaris. In this variant
      `flock` was replaced with `fcntl`, which is a POSIX function.
      
      New functions `lockFile`, `tryLockFile` and `unlockFile` implement
      simple file locking. They lock or unlock entire file. This must be
      enough to support simulataneous writes to log files in parallel builds.
      
      Differential Revision: https://reviews.llvm.org/D78896
      53673699
    • Bruno Ricci's avatar
      [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics. · eb10b065
      Bruno Ricci authored
      Background:
      -----------
      There are two related argument types which can be sent into a diagnostic to
      display the name of an entity: DeclarationName (ak_declarationname) or
      NamedDecl* (ak_nameddecl) (there is also ak_identifierinfo for
      IdentifierInfo*, but we are not concerned with it here).
      
      A DeclarationName in a diagnostic will just be streamed to the output,
      which will directly result in a call to DeclarationName::print.
      
      A NamedDecl* in a diagnostic will also ultimately result in a call to
      DeclarationName::print, but with two customisation points along the way:
      
      The first customisation point is NamedDecl::getNameForDiagnostic which is
      overloaded by FunctionDecl, ClassTemplateSpecializationDecl and
      VarTemplateSpecializationDecl to print the template arguments, if any.
      
      The second customisation point is NamedDecl::printName. By default it just
      streams the stored DeclarationName into the output but it can be customised
      to provide a user-friendly name for an entity. It is currently overloaded by
      DecompositionDecl and MSGuidDecl.
      
      What this patch does:
      ---------------------
      For many diagnostics a DeclarationName is used instead of the NamedDecl*.
      This bypasses the two customisation points mentioned above. This patches fix
      this for diagnostics in Sema.cpp, SemaCast.cpp, SemaChecking.cpp, SemaDecl.cpp,
      SemaDeclAttr.cpp, SemaDecl.cpp, SemaOverload.cpp and SemaStmt.cpp.
      
      I have only modified diagnostics where I could construct a test-case which
      demonstrates that the change is appropriate (either with this patch or the next
      one).
      
      Reviewed By: erichkeane, aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D84656
      eb10b065
    • Bruno Ricci's avatar
      [clang-format][NFC] Be more careful about the layout of FormatToken. · f5acd11d
      Bruno Ricci authored
      The underlying ABI forces FormatToken to have a lot of padding.
      
      Currently (on x86-64 linux) `sizeof(FormatToken) == 288`. After this patch
      `sizeof(FormatToken) == 232`.
      
      No functional changes.
      
      Reviewed By: MyDeveloperDay
      
      Differential Revision: https://reviews.llvm.org/D84306
      f5acd11d
    • Joachim Protze's avatar
      [OpenMP][Tests] Enable nvptx64 testing for most libomptarget tests · e2f5444c
      Joachim Protze authored
      Also add $BUILD/lib to the LIBRARY_PATH to fix
      https://bugs.llvm.org/show_bug.cgi?id=46836.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D84557
      e2f5444c
    • Simon Pilgrim's avatar
      [X86][SSE] Attempt to match OP(SHUFFLE(X,Y),SHUFFLE(X,Y)) -> SHUFFLE(HOP(X,Y)) · 18211177
      Simon Pilgrim authored
      An initial backend patch towards fixing the various poor HADD combines (PR34724, PR41813, PR45747 etc.).
      
      This extends isHorizontalBinOp to check if we have per-element horizontal ops (odd+even element pairs), but not in the expected serial order - in which case we build a "post shuffle mask" that we can apply to the HOP result, assuming we have fast-hops/optsize etc.
      
      The next step will be to extend the SHUFFLE(HOP(X,Y)) combines as suggested on PR41813 - accepting more post-shuffle masks even on slow-hop targets if we can fold it into another shuffle.
      
      Differential Revision: https://reviews.llvm.org/D83789
      18211177
    • serge-sans-paille's avatar
      [legacyPM] Do not compute preserved analysis if there's no local change · 3218c064
      serge-sans-paille authored
      All analysis are preserved if there's no local change, and thanks to
      3667d87a this property is enforced for all
      passes.
      
      Skipping the dependency computation improves the performance when there's a lot
      of small functions, where only a few change happen.
      
      Thanks to Nikita Popov who provided this numbers (extract below)
      
      https://llvm-compile-time-tracker.com/compare.php?from=183342c0a9850e60dd7a004b651c83dfb3a7d25e&to=f2f91e6a2743070471cc9471e4e8c646e50c653c&stat=instructions
      
      O3: (number of instructions)
      Benchmark               Old             New
      kimwitu++               60783M          59968M          (-1.34%)
      sqlite3                 73200M          73083M          (-0.16%)
      consumer-typeset        52776M          52712M          (-0.12%)
      Bullet                  133709M         132940M         (-0.58%)
      tramp3d-v4              123864M         123186M         (-0.55%)
      mafft                   55534M          55477M          (-0.10%)
      ClamAV                  76292M          76164M          (-0.17%)
      lencod                  103190M         103061M         (-0.13%)
      SPASS                   64068M          63713M          (-0.55%)
      7zip                    197332M         196308M         (-0.52%)
      geomean                 85750M          85389M          (-0.42%)
      
      Differential Revision: https://reviews.llvm.org/D80707
      3218c064
    • Georgii Rymar's avatar
      [llvm-readelf] - Do not treat SHT_ANDROID_RELR sections the same as SHT_RELR. · ee068aaf
      Georgii Rymar authored
      Currently, when dumping section headers, llvm-readelf
      prints "RELR" for SHT_ANDROID_RELR/SHT_RELR sections.
      The behavior was introduced in D47919 and revealed in D84330.
      
      But "SHT_ANDROID_RELR" has a different value from "SHT_RELR".
      Also, "SHT_ANDROID_REL/SHT_ANDROID_RELA" are printed as "ANDROID_REL/ANDROID_RELA",
      what makes the handling of the "SHT_ANDROID_RELR" inconsistent.
      
      This patch makes llvm-readelf to print "ANDROID_RELR" instead of "RELR".
      
      Differential revision: https://reviews.llvm.org/D84393
      ee068aaf
    • Kristina Bessonova's avatar
      [clang][cmake] Force CMAKE_LINKER for multistage build in case of... · ad4ab81d
      Kristina Bessonova authored
      [clang][cmake] Force CMAKE_LINKER for multistage build in case of BOOTSTRAP_LLVM_ENABLE_LLD and MSVC
      
      The issue with LLVM_ENABLE_LLD is that it just passes -fuse-ld=lld
      to compiler/linker options which makes sense only for those platforms
      where cmake invokes a compiler driver for linking. On Windows (MSVC) cmake
      invokes the linker directly and requires CMAKE_LINKER to be specified
      otherwise it defaults CMAKE_LINKER to be link.exe.
      
      This patch allows BOOTSTRAP_LLVM_ENABLE_LLD to set CMAKE_LINKER in two cases:
      * if building for host Windows,
      * if crosscompiling for target Windows.
      
      It also skips adding '-fuse-ld=lld' to make lld-link not warning
      about 'unknown argument'.
      
      This fixes build with `clang/cmake/caches/DistributionExample.cmake`
      on Windows.
      
      Reviewed By: phosek
      
      Differential Revision: https://reviews.llvm.org/D80873
      ad4ab81d
    • Chen Zheng's avatar
    • Roman Lebedev's avatar
      [GVN] Rewrite IsValueFullyAvailableInBlock(): no recursion, less false-negatives · e40315d2
      Roman Lebedev authored
      While this doesn't appear to help with the perf issue being exposed by
      D84108, the function as-is is very weird, convoluted, and what's worse,
      recursive.
      
      There was no need for `SpeculativelyAvaliableAndUsedForSpeculation`,
      tri-state choice is enough. We don't even ever check for that state.
      
      The basic idea here is that we need to perform a depth-first traversal
      of the predecessors of the basic block in question, either finding a
      preexisting state for the block in a map, or inserting a "placeholder"
      `SpeculativelyAvaliable`,
      
      If we encounter an `Unavaliable` block, then we need to give up search,
      and back-propagate the `Unavaliable` state to the each successor of
      said block, more specifically to the each `SpeculativelyAvaliable`
      we've just created.
      
      However, if we have traversed entirety of the predecessors and have not
      encountered an `Unavaliable` block, then it must mean the value is fully
      available. We could update each inserted `SpeculativelyAvaliable` into
      a `Avaliable`, but we don't need to, as assertion excersizes,
      because we can assume that if we see an `SpeculativelyAvaliable` entry,
      it is actually `Avaliable`, because during the time we've produced it,
      if we would have found that it has an `Unavaliable` predecessor,
      we would have updated it's successors, including this block,
      into `Unavaliable`
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D84181
      e40315d2
    • Ehsan Toosi's avatar
      [mlir][NFC] Polish copy removal transform · 486d2750
      Ehsan Toosi authored
      Address a few remaining comments in copy removal transform.
      
      Differential Revision: https://reviews.llvm.org/D84529
      486d2750
    • Artem Dergachev's avatar
      [clang-tidy] Suppress one unittest on macOS. · 8c9241a0
      Artem Dergachev authored
      Possibly a linker bug but I'm in a hurry to fix a buildbot.
      
      Differential Revision: https://reviews.llvm.org/D84453
      8c9241a0
    • Craig Topper's avatar
      [X86] Detect if EFLAGs is live across XBEGIN pseudo instruction. Add it as... · 647e861e
      Craig Topper authored
      [X86] Detect if EFLAGs is live across XBEGIN pseudo instruction. Add it as livein to the basic blocks created when expanding the pseudo
      
      XBEGIN causes several based blocks to be inserted. If flags are live across it we need to make eflags live in the new basic blocks to avoid machine verifier errors.
      
      Fixes PR46827
      
      Reviewed By: ivanbaev
      
      Differential Revision: https://reviews.llvm.org/D84479
      647e861e
    • Craig Topper's avatar
      [X86] Add support for {disp32} to control size of jmp and jcc instructions in the assembler · 25f193fb
      Craig Topper authored
      By default we pick a 1 byte displacement and let relaxation enlarge it if necessary. The GNU assembler supports a pseudo prefix to basically pre-relax the instruction the larger size.
      
      I plan to add {disp8} and {disp32} support for memory operands in another patch which is why I've included the parsing code and enum for {disp8} pseudo prefix as well.
      
      Reviewed By: echristo
      
      Differential Revision: https://reviews.llvm.org/D84709
      25f193fb
    • Craig Topper's avatar
      [X86] Properly encode a 32-bit address with an index register and no base register in 16-bit mode. · a0ebac52
      Craig Topper authored
      In 16-bit mode we can encode a 32-bit address using 0x67 prefix.
      We were failing to do this when the index register was a 32-bit
      register, the base register was not present, and the displacement
      fit in 16-bits.
      
      Fixes PR46866.
      a0ebac52
    • Wei Mi's avatar
      Supplement instr profile with sample profile. · a23f6234
      Wei Mi authored
      PGO profile is usually more precise than sample profile. However, PGO profile
      needs to be collected from loadtest and loadtest may not be representative
      enough to the production workload. Sample profile collected from production
      can be used as a supplement -- for functions cold in loadtest but warm/hot
      in production, we can scale up the related function in PGO profile if the
      function is warm or hot in sample profile.
      
      The implementation contains changes in compiler side and llvm-profdata side.
      Given an instr profile and a sample profile, for a function cold in PGO
      profile but warm/hot in sample profile, llvm-profdata will either mark
      all the counters in the profile to be -1 or scale up the max count in the
      function to be above hot threshold, depending on the zero counter ratio in
      the profile. The assumption is if there are too many counters being zero
      in the function profile, the profile is more likely to cause harm than good,
      then llvm-profdata will mark all the counters to be -1 indicating the
      function is hot but the profile is unaccountable. In compiler side, if a
      function profile with all -1 counters is seen, the function entry count will
      be set to be above hot threshold but its internal profile will be dropped.
      
      In the long run, it may be useful to let compiler support using PGO profile
      and sample profile at the same time, but that requires more careful design
      and more substantial changes to make two profiles work seamlessly. The patch
      here serves as a simple intermediate solution.
      
      Differential Revision: https://reviews.llvm.org/D81981
      a23f6234
    • Richard Smith's avatar
      Don't form a 'context-independent expr' reference to a member during · 23d6525c
      Richard Smith authored
      name annotation.
      
      Instead, defer forming the member access expression or DeclRefExpr until
      we build the use of ClassifyName's result. Just build an
      UnresolvedLookupExpr to track the LookupResult until we're ready to
      consume it.
      
      This also reverts commit 2f7269b6 (other
      than its testcase). That change was an attempted workaround for the same
      problem.
      23d6525c
    • Xing GUO's avatar
      [llvm-readelf] Fix emitting incorrect number of spaces in '--hex-dump'. · 6bf989b9
      Xing GUO authored
      This patch helps teach llvm-readelf to emit a correct number spaces when
      dumping in hex format.
      
      Before this patch, when the hex data doesn't fill the 4th column, some
      spaces are missing.
      
      ```
      Hex dump of section '.sec':
      0x00000000 00000000 00000000 00000000 00000000 ................
      0x00000010 00000000 00000000 00000000 0000 ..............
      ```
      
      After this patch:
      
      ```
      Hex dump of section '.sec':
      0x00000000 00000000 00000000 00000000 00000000 ................
      0x00000010 00000000 00000000 00000000 0000     ..............
      ```
      
      Reviewed By: grimar
      
      Differential Revision: https://reviews.llvm.org/D84640
      6bf989b9
    • Matt Arsenault's avatar
      TableGen: Check if pattern outputs matches instruction defs · 930fc0b3
      Matt Arsenault authored
      Attempt to fix address sanitizer bots when building ARM.
      930fc0b3
    • Alina Sbirlea's avatar
      [CFGDiff] Refactor Succ/Pred maps. · fbca3176
      Alina Sbirlea authored
      Summary:
      Refactor Succ/Pred maps to have a single map lookup when constructing
      children. The preivous desing made sense when used by GraphTraits.
      This more closely matches the previous approach in DomTree.
      
      Reviewers: dblaikie
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D84567
      fbca3176
    • Alina Sbirlea's avatar
      [DomTree] Remove dead code.[NFC] · 18c725e7
      Alina Sbirlea authored
      18c725e7
    • Fred Riss's avatar
      [lldb/ArchSpec] Always match simulator environment in IsEqualTo · 8120eba5
      Fred Riss authored
      Summary:
      Initially, Apple simulator binarie triples didn't use a `-simulator`
      environment and were just differentiated based on the architecture.
      For example, `x86_64-apple-ios` would obviously be a simualtor as iOS
      doesn't run on x86_64. With Catalyst, we made the disctinction
      explicit and today, all simulator triples (even the legacy ones) are
      constructed with an environment. This is especially important on Apple
      Silicon were the architecture is not different from the one of the
      simulated device.
      
      This change makes the simulator part of the environment always part of
      the criteria to detect whether 2 `ArchSpec`s are equal or compatible.
      
      Reviewers: aprantl
      
      Subscribers: inglorion, dexonsmith, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D84716
      8120eba5
    • Petr Hosek's avatar
      [CMake] Move find_package(ZLIB) to LLVMConfig · 64d99cc6
      Petr Hosek authored
      This way, downstream projects don't have to invoke find_package(ZLIB)
      reducing the amount of boilerplate.
      
      Differential Revision: https://reviews.llvm.org/D84691
      64d99cc6
    • Joel E. Denny's avatar
      f250eb37
    • Alina Sbirlea's avatar
      [GraphDiff] Use class method getChildren instead of GraphTraits. · f1d4db4f
      Alina Sbirlea authored
      Summary:
      Use getChildren() method in GraphDiff instead of GraphTraits.
      
      This simplifies the code and allows for refactorigns inside GraphDiff.
      All usecase need not have a light-weight/copyable range.
      Clean GraphTraits implementation.
      
      Reviewers: dblaikie
      
      Subscribers: hiraditya, llvm-commits, george.burgess.iv
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D84562
      f1d4db4f
    • Matt Arsenault's avatar
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Mark G_ATOMICRMW_{NAND|FSUB} as lower · ce944af3
      Matt Arsenault authored
      These aren't implemented and we're still relying on the AtomicExpand
      pass, but mark these as lower to eliminate a few of the few remaining
      no rules defined cases.
      ce944af3
    • Matt Arsenault's avatar
    • Jonas Devlieghere's avatar
      [llvm] Make ZLIB handling compatible with multi-configuration generators · f9fec044
      Jonas Devlieghere authored
      The CMAKE_BUILD_TYPE is only meaningful to single-configuration
      generators (such as make and Ninja). For multi-configuration generators
      like Xcode and MSVC this variable won't be set, resulting in a CMake
      error.
      f9fec044
    • Matt Arsenault's avatar
      TableGen/GlobalISel: Allow output instructions with multiple defs · ee3feef5
      Matt Arsenault authored
      The DAG behavior allows matchching input patterns with a single result
      to the first result of an output instruction that defines multiple
      results. The remaining defs are implicitly dead.
      
      This starts to fix using manual selection for AMDGPU add/sub (although
      it's still needed, mostly because it's also still needed for
      G_PTR_ADD).
      ee3feef5
    • Francesco Petrogalli's avatar
      [llvm][CodeGen] Addressing modes for SVE ldN. · adb28e0f
      Francesco Petrogalli authored
      Reviewers: c-rhodes, efriedma, sdesmalen
      
      Subscribers: huihuiz, tschuett, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77251
      adb28e0f
    • peter klausler's avatar
      [flang] Allow omission of comma in FORMAT(1PE5.2) in runtime · e5746415
      peter klausler authored
      A comma is not required between a scale factor and a following
      data edit descriptor (C1302).
      
      Reviewed By: PeteSteinfeld
      
      Differential Revision: https://reviews.llvm.org/D84369
      e5746415
  2. Jul 27, 2020
Loading