Skip to content
  1. Jul 10, 2018
    • Paul Robinson's avatar
      Support -fdebug-prefix-map for assembler source (pass to cc1as). This · 9b292b45
      Paul Robinson authored
      is useful to omit the debug compilation dir when compiling assembly
      files with -g.  Part of PR38050.
      
      Patch by Siddhartha Bagaria!
      
      Differential Revision: https://reviews.llvm.org/D48989
      
      llvm-svn: 336685
      9b292b45
    • Sanjay Patel's avatar
      [InstCombine] safely allow non-commutative binop identity constant folds · 509a1e7a
      Sanjay Patel authored
      This was originally intended with D48893, but as discussed there, we
      have to make the folds safe from producing extra poison. This should
      give the single binop folds the same capabilities as the existing
      folds for 2-binops+shuffle.
      
      LLVM binary opcode review: there are a total of 18 binops. There are 7 
      commutative binops (add, mul, and, or, xor, fadd, fmul) which we already 
      fold. We're able to fold 6 more opcodes with this patch (shl, lshr, ashr,
      fdiv, udiv, sdiv). There are no folds for srem/urem/frem AFAIK. We don't 
      bother with sub/fsub with constant operand 1 because those are 
      canonicalized to add/fadd. 7 + 6 + 3 + 2 = 18.
      
      llvm-svn: 336684
      509a1e7a
    • Rui Ueyama's avatar
      Add CachedHashStringRef::data(). · ac7d10bb
      Rui Ueyama authored
      This accessor is useful and could be slightly more efficient than
      Str.val().data() because you can avoid StringRef instantiation.
      
      Differential Revision: https://reviews.llvm.org/D49133
      
      llvm-svn: 336683
      ac7d10bb
    • Krzysztof Parzyszek's avatar
      [Hexagon] Change .mir testcase to make sure function is not in SSA form · c87ecf25
      Krzysztof Parzyszek authored
      If a machine function satisfies SSA, the IsSSA property is assumed even
      if the pass to be executed runs after existing from SSA. If the pass
      output then does not conform to SSA, a verifier error will be flagged
      (with expensive checks enabled).
      
      llvm-svn: 336682
      c87ecf25
    • Matt Arsenault's avatar
      AMDGPU: Try to fix test again · 1dae500c
      Matt Arsenault authored
      llvm-svn: 336681
      1dae500c
    • Paul Robinson's avatar
      Support -fdebug-prefix-map in llvm-mc. This is useful to omit the · c17c8bf7
      Paul Robinson authored
      debug compilation dir when compiling assembly files with -g.
      Part of PR38050.
      
      Patch by Siddhartha Bagaria!
      
      Differential Revision: https://reviews.llvm.org/D48988
      
      llvm-svn: 336680
      c17c8bf7
    • Sanjay Patel's avatar
      3333106a
    • Marco Castelluccio's avatar
      Reapply "Make __gcov_flush flush counters for all shared libraries" · 2827420a
      Marco Castelluccio authored
      This reapplies r336365, after marking tests as failing on various
      configurations.
      
      llvm-svn: 336678
      2827420a
    • Sander de Smalen's avatar
      [AArch64][SVE] Asm: Support for predicated unary operations. · 53108d48
      Sander de Smalen authored
      This patch adds support for the following instructions:
        CLS  (Count Leading Sign bits)
        CLZ  (Count Leading Zeros)
        CNT  (Count non-zero bits)
        CNOT (Logically invert boolean condition in vector)
        NOT  (Bitwise invert vector)
        FABS (Floating-point absolute value)
        FNEG (Floating-point negate)
      
      All operations are predicated and unary, e.g.
        clz  z0.s, p0/m, z1.s
      
      - CLS, CLZ, CNT, CNOT and NOT have variants for 8, 16, 32
        and 64 bit elements.
      
      - FABS and FNEG have variants for 16, 32 and 64 bit elements.
      
      llvm-svn: 336677
      53108d48
    • Matt Arsenault's avatar
      Update test for backend error message change · 3ae7d63c
      Matt Arsenault authored
      llvm-svn: 336676
      3ae7d63c
    • Matt Arsenault's avatar
      Reapply "AMDGPU: Force inlining if LDS global address is used" · a680199a
      Matt Arsenault authored
      This reverts commit r336623
      
      llvm-svn: 336675
      a680199a
    • Rui Ueyama's avatar
      Rename a variable for consistency. NFC. · 3467fac0
      Rui Ueyama authored
      llvm-svn: 336674
      3467fac0
    • Filipe Cabecinhas's avatar
      [scudo] Use mkdir -p when creating directories for a test · f6cf891b
      Filipe Cabecinhas authored
      llvm-svn: 336673
      f6cf891b
    • Rui Ueyama's avatar
      Reduce memory usage when creating .gdb_index. NFC. · 7f112ea2
      Rui Ueyama authored
      .gdb_index sections can be very large. When you are compiling
      multi-gibibyte executables, they can be larger than 1 GiB. The previous
      implementation of .gdb_index seems to consume too much memory.
      
      This patch reduces memory consumption by eliminating temporary objects.
      In one experiment, memory consumption of GdbIndexSection class is
      reduced from 962 MiB to 228 MiB when creating a .gdb_index of 1350 GiB.
      
      Differential Revision: https://reviews.llvm.org/D49094
      
      llvm-svn: 336672
      7f112ea2
    • Mikhail R. Gadelha's avatar
      [analyzer] Add option to set maximum symbol complexity threshold · 237d42bf
      Mikhail R. Gadelha authored
      Summary:
      This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold.
      
      Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000.
      
      This patch was extracted and modified from Dominic Chen's patch, D35450.
      
      Reviewers: george.karpenkov, NoQ, ddcc
      
      Reviewed By: george.karpenkov
      
      Subscribers: xazax.hun, szepet, a.sidorin
      
      Differential Revision: https://reviews.llvm.org/D49093
      
      llvm-svn: 336671
      237d42bf
    • George Rimar's avatar
      [ELF] - Add a test for readCallGraph() code. · 92108de5
      George Rimar authored
      This is to test the following untested line:
      https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L643
      
      llvm-svn: 336670
      92108de5
    • Dan Liew's avatar
      [LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitizer is · 9af77974
      Dan Liew authored
      not supported on Darwin currently and so Clang refuses to compile with
      `-fsanitize=memory`.
      
      llvm-svn: 336669
      9af77974
    • Sanjay Patel's avatar
      [InstCombine] allow more shuffle-binop folds with safe constants · 06ea4206
      Sanjay Patel authored
      The case with 2 variables is more complicated than the case where
      we eliminate the shuffle entirely because a shuffle with an undef 
      mask element creates an undef result. 
      
      I'm not aware of any current analysis/transform that recognizes that 
      undef propagating to a div/rem/shift, but we have to guard against 
      the possibility.
      
      llvm-svn: 336668
      06ea4206
    • Anastasis Grammenos's avatar
      [DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add · 612bf7ca
      Anastasis Grammenos authored
      Differential Revision: https://reviews.llvm.org/D48968
      
      llvm-svn: 336667
      612bf7ca
    • Eric Fiselier's avatar
      Remove BUILD file from google-benchmark · 9cc6d3b3
      Eric Fiselier authored
      llvm-svn: 336666
      9cc6d3b3
    • Louis Dionne's avatar
      [libc++] Declare <compare> operators with the proper visibility attribute · be4d99dd
      Louis Dionne authored
      Summary:
      Many operators in <compare> were _defined_ with the proper visibility attribute,
      but they were _declared_ without any. This is not a problem until we change the
      definition of _LIBCPP_INLINE_VISIBILITY to something that requires the
      declaration to be decorated.
      
      I also marked `strong_equality::operator weak_equality()` as
      `_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten.
      
      This came up while trying to get rid of `__attribute__((__always_inline__))`
      in favor of `__attribute__((internal_linkage))`.
      
      Reviewers: EricWF, mclow.lists
      
      Subscribers: christof, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49104
      
      llvm-svn: 336665
      be4d99dd
    • Simon Pilgrim's avatar
      [DAGCombiner] visitREM - call visitSDIVLike/visitUDIVLike directly to avoid recursive combining. · 641097d5
      Simon Pilgrim authored
      As suggested by @efriedma on D48975 use the visitSDIVLike/visitUDIVLike functions introduced at rL336656.
      
      llvm-svn: 336664
      641097d5
    • Dan Liew's avatar
      [CMake] Add compiler-rt header files to the list of sources for targets · b1f95697
      Dan Liew authored
      when building with an IDE so that header files show up in the UI.
      This massively improves the development workflow in IDEs.
      
      To implement this a new function `compiler_rt_process_sources(...)` has
      been added that adds header files to the list of sources when the
      generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no
      changes are made to the list of source files.
      
      The function can be passed a list of headers via the
      `ADDITIONAL_HEADERS` argument. For each runtime library a list of
      explicit header files has been added and passed via
      `ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of
      headers was already present but it was stale and has been updated
      to reflect the current state of the source tree.
      
      The original version of this patch used file globbing (`*.{h,inc,def}`)
      to find the headers but the approach was changed due to this being a
      CMake anti-pattern (if the list of headers changes CMake won't
      automatically re-generate if globbing is used).
      
      The LLVM repo contains a similar function named `llvm_process_sources()`
      but we don't use it here for several reasons:
      
      * It depends on the `LLVM_ENABLE_OPTION` cache variable which is
        not set in standalone compiler-rt builds.
      * We would have to `include(LLVMProcessSources)` which I'd like to
        avoid because it would include a bunch of stuff we don't need.
      
      Differential Revision: https://reviews.llvm.org/D48422
      
      llvm-svn: 336663
      b1f95697
    • Krzysztof Parzyszek's avatar
      [Hexagon] Add implicit uses even when untied explicit uses are present · c052451a
      Krzysztof Parzyszek authored
      An explicit untied use is not sufficient to maintain liveness of a
      register redefined in a predicated instruction. For example
        %1 = COPY %0
        ...
        %1 = A2_paddif %2, %1, 1
      could become
        $r1 = COPY $r0
        ...
        $r1 = A2_paddif $p0, $r1, 1
      and later
        $r1 = COPY $r0                ;; this is not really dead!
        ...
        $r1 = A2_paddif $p0, $r0, 1
      
      llvm-svn: 336662
      c052451a
    • Filipe Cabecinhas's avatar
      [compiler-rt] Get rid of "%T" expansions · 6a9c719e
      Filipe Cabecinhas authored
      Summary:
      Original patch by Kuba Mracek
      
      The %T lit expansion expands to a common directory shared between all
      the tests in the same directory, which is unexpected and unintuitive,
      and more importantly, it's been a source of subtle race conditions and
      flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it
      would be best to simply ban %T and only keep %t, which is unique to each
      test. When a test needs a temporary directory, it can just create one
      using mkdir %t.
      
      This patch removes %T in compiler-rt.
      
      Differential Revision: https://reviews.llvm.org/D48618
      
      llvm-svn: 336661
      6a9c719e
    • Yuka Takahashi's avatar
      [modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts · a1536415
      Yuka Takahashi authored
      Summary:
      Reproducer and errors:
      https://bugs.llvm.org/show_bug.cgi?id=37878
      
      lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't
      find ModuleName in (proper) search paths. This was causing iteration over all
      files in the search path subdirectories for example "/usr/include/foobar" in
      bugzilla case.
      
      Users don't expect Clang to load modulemaps in subdirectories implicitly, and
      also the disk access is not cheap.
      
      if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName.
      
      Reviewers: rsmith, aprantl, bruno
      
      Subscribers: cfe-commits, teemperor, v.g.vassilev
      
      Differential Revision: https://reviews.llvm.org/D48367
      
      llvm-svn: 336660
      a1536415
    • Karl-Johan Karlsson's avatar
      [LowerSwitch] Fixed faulty PHI nodes · 1ffeb5d7
      Karl-Johan Karlsson authored
      Summary:
      Fixed two cases of where PHI nodes need to be updated by lowerswitch.
      
      When lowerswitch find out that the switch default branch is not
      reachable it remove the old default and replace it with the most
      popular block from the cases, but it forget to update the PHI
      nodes in the default block.
      
      The PHI nodes also need to be updated when the switch is replaced
      with a single branch.
      
      Reviewers: hans, reames, arsenm
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D47203
      
      llvm-svn: 336659
      1ffeb5d7
    • Omer Paparo Bivas's avatar
      Fixing builtin __atomic_fetch_min declaration · d2f5a6f7
      Omer Paparo Bivas authored
      Differential Revision: http://reviews.llvm.org/D49068
      
      llvm-svn: 336658
      d2f5a6f7
    • Sam McCall's avatar
      [Support] Harded JSON against invalid UTF-8. · e6057bc6
      Sam McCall authored
      Parsing invalid UTF-8 input is now a parse error.
      Creating JSON values from invalid UTF-8 now triggers an assertion, and
      (in no-assert builds) substitutes the unicode replacement character.
      Strings retrieved from json::Value are always valid UTF-8.
      
      llvm-svn: 336657
      e6057bc6
    • Simon Pilgrim's avatar
      [DAGCombiner] Split SDIV/UDIV optimization expansions from the rest of the combines. NFCI. · ce5c19b6
      Simon Pilgrim authored
      As suggested by @efriedma on D48975, this patch separates the BuildDiv/Pow2 style optimizations from the rest of the visitSDIV/visitUDIV to make it easier to reuse the combines and will allow us to avoid some rather nasty node recursive combining in visitREM.
      
      llvm-svn: 336656
      ce5c19b6
    • Martin Storsjö's avatar
      [MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified · 006bffe2
      Martin Storsjö authored
      In this setup, skip adding all the default windows import libraries,
      if linking to windowsapp (which replaces them, when targeting the
      windows store/UWP api subset).
      
      With GCC, the same is achieved by using a custom spec file, but
      since clang doesn't use spec files, we have to allow other means of
      overriding what default libraries to use (without going all the
      way to using -nostdlib, which would exclude everything). The same
      approach, in detecting certain user specified libraries and omitting
      others from the defaults, was already used in SVN r314138.
      
      Differential Revision: https://reviews.llvm.org/D49059
      
      llvm-svn: 336655
      006bffe2
    • Martin Storsjö's avatar
      [MinGW] Treat any -lucrt* as replacing -lmsvcrt · 995e5961
      Martin Storsjö authored
      Since SVN r314138, we check if the user has specified any particular
      alternative msvcrt/ucrt version, and skip the default -lmsvcrt
      in those cases.
      
      In addition to the existing names checked, we should also treat
      a plain -lucrt in the same way, mingw-w64 has now added a separate
      import library named libucrt.a, in addition to libucrtbase.a.
      
      Differential Revision: https://reviews.llvm.org/D49054
      
      llvm-svn: 336654
      995e5961
    • Florian Hahn's avatar
      [VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests. · 8263975c
      Florian Hahn authored
      Reviewers: dcaballe, hsaito, rengolin
      
      Reviewed By: dcaballe
      
      Differential Revision: https://reviews.llvm.org/D49032
      
      llvm-svn: 336653
      8263975c
    • Martin Storsjö's avatar
      [COFF] Store import symbol pointers as pointers to the base class · 474be005
      Martin Storsjö authored
      Future symbol insertions can potentially change the type of these
      symbols - keep pointers to the base class to reflect this, and
      use dynamic casts to inspect them before using as the subclass
      type.
      
      This fixes crashes that were possible before, by touching these
      symbols that now are populated as e.g. a DefinedRegular, via
      the old pointers with DefinedImportThunk type.
      
      Differential Revision: https://reviews.llvm.org/D48953
      
      llvm-svn: 336652
      474be005
    • George Rimar's avatar
      [ELF] - Improve call graph pasing error reporting. · bc6702a4
      George Rimar authored
      This adds a file name to the error message,
      adds a missing test case and refactors code a bit. 
      
      llvm-svn: 336651
      bc6702a4
    • George Rimar's avatar
      [ELF] - Report call graph profile file names in error messages. · 20b92c4d
      George Rimar authored
      We did not report file names for some reason.
      
      llvm-svn: 336650
      20b92c4d
    • Simon Pilgrim's avatar
      Fix MSVC "signed/unsigned mismatch" warning. NFCI. · c048599f
      Simon Pilgrim authored
      llvm-svn: 336649
      c048599f
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Fixup build breakage · b251f624
      Dean Michael Berris authored
      Changes:
      
      - Remove static assertion on size of a structure, fails on systems where
        pointers aren't 8 bytes.
      
      - Use size_t instead of deducing type of arguments to
        `nearest_boundary`.
      
      Follow-up to D48653.
      
      llvm-svn: 336648
      b251f624
    • Chandler Carruth's avatar
      [PM/Unswitch] Fix unused variable in r336646. · 148861f5
      Chandler Carruth authored
      llvm-svn: 336647
      148861f5
    • Chandler Carruth's avatar
      [PM/Unswitch] Fix a collection of closely related issues with trivial · 47dc3a34
      Chandler Carruth authored
      switch unswitching.
      
      The core problem was that the way we handled unswitching trivial exit
      edges through the default successor of a switch. For some reason
      I thought the right way to do this was to add a block containing
      unreachable and point the default successor at this block. In
      retrospect, this has an amazing number of problems.
      
      The first issue is the one that this pass has always worked around -- we
      have to *detect* such edges and avoid unswitching them again. This
      seemed pretty easy really. You juts look for an edge to a block
      containing unreachable. However, this pattern is woefully unsound. So
      many things can break it. The amazing thing is that I found a test case
      where *simple-loop-unswitch itself* breaks this! When we do
      a *non-trivial* unswitch of a switch we will end up splitting this exit
      edge. The result will be a default successor that is an exit and
      terminates in ... a perfectly normal branch. So the first test case that
      I started trying to fix is added to the nontrivial test cases. This is
      a ridiculous example that did just amazing things previously. With just
      unswitch, it would create 10+ copies of this stuff stamped out. But if
      you combine it *just right* with a bunch of other passes (like
      simplify-cfg, loop rotate, and some LICM) you can get it to do this
      infinitely. Or at least, I never got it to finish. =[
      
      This, in turn, uncovered another related issue. When we are manipulating
      these switches after doing a trivial unswitch we never correctly updated
      PHI nodes to reflect our edits. As soon as I started changing how these
      edges were managed, it became obvious there were more issues that
      I couldn't realistically leave unaddressed, so I wrote more test cases
      around PHI updates here and ensured all of that works now.
      
      And this, in turn, required some adjustment to how we collect and manage
      the exit successor when it is the default successor. That showed a clear
      bug where we failed to include it in our search for the outer-most loop
      reached by an unswitched exit edge. This was actually already tested and
      the test case didn't work. I (wrongly) thought that was due to SCEV
      failing to analyze the switch. In fact, it was just a simple bug in the
      code that skipped the default successor. While changing this, I handled
      it correctly and have updated the test to reflect that we now get
      precise SCEV analysis of trip counts for the outer loop in one of these
      cases.
      
      llvm-svn: 336646
      47dc3a34
Loading