1. Mar 31, 2019
  2. Mar 30, 2019
    • Alex Bradbury's avatar
      [RISCV] Add RV64 CHECK lines to test/CodeGen/RISCV/vararg.ll and prepare for hard float tests · b5498cbf
      Alex Bradbury authored
      vararg.ll previously missed RV64 tests. This patch also prepares for using
      vararg.ll to test handling of varargs for the ilp32f/ilp32d/lp64f/lp64d hard
      float ABIs. In these ABIs, varargs are passed as in either the ilp32 or lp64
      ABI. Due to some slight codegen differences, different check lines are needed
      for when RV32D is enabled.
      
      llvm-svn: 357350
      b5498cbf
    • Simon Pilgrim's avatar
      [X86][SSE] detectAVGPattern - begin generalizing ADD matches · 32934555
      Simon Pilgrim authored
      Move the ADD matching into a helper - first NFC stage towards supporting 'ADD like' cases such as in PR41316
      
      llvm-svn: 357349
      32934555
    • Fangrui Song's avatar
      [cmake] Change deprecated $<CONFIG> to $<CONFIGURATION>. NFC · 7dd1c36c
      Fangrui Song authored
      See rL357338 for a similar change. The informational expression
      $<CONFIGURATION> has been deprecated since CMake 3.0
      
      llvm-svn: 357348
      7dd1c36c
    • Fangrui Song's avatar
      [llvm-objcopy] Replace the size() helper with SectionTableRef::size · 82b01e00
      Fangrui Song authored
      Summary:
      BTW, STLExtras.h provides llvm::size() which is similar to std::size()
      for random access iterators. However, if we prefer qualified
      llvm::size(), the member function .size() will be more convenient.
      
      Reviewers: jhenderson, jakehehrlich, rupprecht, grimar, alexshap, espindola
      
      Reviewed By: grimar
      
      Subscribers: emaste, arichardson, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60028
      
      llvm-svn: 357347
      82b01e00
    • Simon Pilgrim's avatar
      [X86][SSE] Add PAVG test case from PR41316 · cfdf09ba
      Simon Pilgrim authored
      llvm-svn: 357346
      cfdf09ba
    • Paul Hoad's avatar
      [clang-format] [PR41187] moves Java import statements to the wrong location if... · 88335c21
      Paul Hoad authored
      [clang-format] [PR41187] moves Java import statements to the wrong location if code contains statements that start with the word import
      
      Summary:
      Import sorting of java file, incorrectly move import statement to after a function beginning with the word import.
      
      Make 1 character change to regular expression to ensure there is always at least one space/tab after the word import
      
      Previously clang-format --style="LLVM" would format
      
      ```
      import X;
      
      class C {
        void m() {
          importFile();
        }
      }
      ```
      as
      
      ```
      class C {
        void m() {
          importFile();
      import X;
        }
      }
      ```
      
      Reviewers: djasper, klimek, reuk, JonasToth
      
      Reviewed By: klimek
      
      Subscribers: cfe-commits
      
      Tags: #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D59684
      
      llvm-svn: 357345
      88335c21
    • Reuben Thomas's avatar
      [clang-format]: Add NonEmptyParentheses spacing option · 08a940d6
      Reuben Thomas authored
      This patch aims to add support for the following rules from the JUCE coding standards:
      
      - Always put a space before an open parenthesis that contains text - e.g. foo (123);
      - Never put a space before an empty pair of open/close parenthesis - e.g. foo();
      
      Patch by Reuben Thomas
      
      Differential Revision: https://reviews.llvm.org/D55170
      
      llvm-svn: 357344
      08a940d6
    • Heejin Ahn's avatar
      [WebAssembly] Fix unwind destination mismatches in CFG stackify · c4ac74fb
      Heejin Ahn authored
      Summary:
      Linearing the control flow by placing `try`/`end_try` markers can create
      mismatches in unwind destinations. This patch resolves these mismatches
      by wrapping those instructions with an incorrect unwind destination with
      a nested `try`/`catch`/`end_try` and branching to the right destination
      within the new catch block.
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, chrib, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D48345
      
      llvm-svn: 357343
      c4ac74fb
    • Heejin Ahn's avatar
      [WebAssembly] Run ExplicitLocals pass after CFGStackify · e9fd9073
      Heejin Ahn authored
      Summary:
      While this does not change any final output, this will greatly simplify
      ixing unwind destination mismatches in CFGStackify (D48345), because we
      have to create some new registers there.
      
      Reviewers: dschuff
      
      Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59652
      
      llvm-svn: 357342
      e9fd9073
    • Alex Bradbury's avatar
      [RISCV] Add DAGCombine for (SplitF64 (ConstantFP x)) · 9681b01c
      Alex Bradbury authored
      The SplitF64 node is used on RV32D to convert an f64 directly to a pair of i32
      (necessary as bitcasting to i64 isn't legal). When performed on a ConstantFP,
      this will result in a FP load from the constant pool followed by a store to
      the stack and two integer loads from the stack (necessary as there is no way
      to directly move between f64 FPRs and i32 GPRs on RV32D). It's always cheaper
      to just materialise integers for the lo and hi parts of the FP constant, so do
      that instead.
      
      llvm-svn: 357341
      9681b01c
    • Anton Afanasyev's avatar
      Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing`... · d880de2d
      Anton Afanasyev authored
      Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` compatible JSON profiling output dumps.
      
      This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc.
      
      This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2
      
      Patch by Aras Pranckevičius.
      
      Differential Revision: https://reviews.llvm.org/D58675
      
      llvm-svn: 357340
      d880de2d
    • Alex Bradbury's avatar
      [RISCV][NFC] Remove floating point operations from test/CodeGen/RISCV/vararg.ll · 98b8ecde
      Alex Bradbury authored
      This minimises differences in output when compiling with hardware floating
      point support, which will be done in a future patch (to demonstrate the same
      vararg calling convention is used).
      
      llvm-svn: 357339
      98b8ecde
    • Shoaib Meenai's avatar
      [cmake] Remove use of deprecated generator expression. NFC · ff852744
      Shoaib Meenai authored
      Use $<CONFIG> instead of $<CONFIGURATION>, since the latter has been
      deprecated since CMake 3.0, and the former is entirely equivalent.
      
      llvm-svn: 357338
      ff852744
    • Heejin Ahn's avatar
      [WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG · 7e7aad15
      Heejin Ahn authored
      Summary:
      Currently we create a routing block to the dispatch block for every
      predecessor of every entry. So the total number of routing blocks
      created will be (# of preds) * (# of entries). But we don't need to do
      this: we need at most 2 routing blocks per loop entry, one for when the
      predecessor is inside the loop and one for it is outside the loop. (We
      can't merge these into one because this will creates another loop cycle
      between blocks inside and blocks outside) This patch fixes this and
      creates at most 2 routing blocks per entry.
      
      This also renames variable `Split` to `Routing`, which I think is a bit
      clearer.
      
      Reviewers: kripken
      
      Subscribers: sunfish, dschuff, sbc100, jgravelle-google, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59462
      
      llvm-svn: 357337
      7e7aad15
    • David Zarzycki's avatar
      [CMake] Add missing test dep · 916709e0
      David Zarzycki authored
      lit/SymbolFile/NativePDB/globals-bss.cpp needs llvm-readobj
      
      llvm-svn: 357336
      916709e0
    • Artem Dergachev's avatar
      [analyzer] MIGChecker: Add support for more deallocator APIs. · a3c9d882
      Artem Dergachev authored
      Differential Revision: https://reviews.llvm.org/D59914
      
      llvm-svn: 357335
      a3c9d882
    • Hubert Tong's avatar
      [lit] Set shlibpath_var on AIX · 5dc6a732
      Hubert Tong authored
      Summary:
      When building the `check-all` target on AIX, lit produces
      ```
      warning: unable to inject shared library path on 'AIX'
      ```
      
      This patch addresses this. `LIBPATH` is the environment variable of
      interest on AIX. Newer versions of AIX may consider `LD_LIBRARY_PATH`,
      but only when `LIBPATH` is unset.
      
      Reviewers: xingxue, jasonliu, sfertile, serge-sans-paille
      
      Reviewed By: xingxue
      
      Subscribers: jsji, cfe-commits, llvm-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59741
      
      llvm-svn: 357334
      5dc6a732
    • Hubert Tong's avatar
      [Support] Implement is_local_impl with AIX mntctl · 24168852
      Hubert Tong authored
      Summary:
      On AIX, we can determine whether a filesystem is remote using `mntctl`.
      
      If the information is not found, then claim that the file is remote
      (since that is the more restrictive case). Testing for the associated
      interface is restored with a modified version of the unit test from
      rL295768.
      
      Reviewers: jasonliu, xingxue
      
      Reviewed By: xingxue
      
      Subscribers: jsji, apaprocki, Hahnfeld, zturner, krytarowski, kristina, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58801
      
      llvm-svn: 357333
      24168852
    • Artem Dergachev's avatar
      Revert "[analyzer] Introduce a simplified API for adding custom path notes." · 4d6fb578
      Artem Dergachev authored
      This reverts commit r357323.
      
      ASan leaks found by a buildbot :)
      
      Differential Revision: https://reviews.llvm.org/D58367
      
      llvm-svn: 357332
      4d6fb578
    • Philip Reames's avatar
      [LoopPredication] Remove stale TODO · b55637b5
      Philip Reames authored
      llvm-svn: 357331
      b55637b5
    • Philip Reames's avatar
      [LoopPredication] Use the builder's insertion point everywhere [NFC] · 3d4e1082
      Philip Reames authored
      llvm-svn: 357330
      3d4e1082
    • Artem Dergachev's avatar
      [analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor. · 388e19ff
      Artem Dergachev authored
      It turns out that SourceManager::isInSystemHeader() crashes when an invalid
      source location is passed into it. Invalid source locations are relatively
      common: not only they come from body farms, but also, say, any function in C
      that didn't come with a forward declaration would have an implicit
      forward declaration with invalid source locations.
      
      There's a more comfy API for us to use in the Static Analyzer:
      CallEvent::isInSystemHeader(), so just use that.
      
      Differential Revision: https://reviews.llvm.org/D59901
      
      llvm-svn: 357329
      388e19ff
    • Sam Clegg's avatar
      Re-land "[WebAssembly] Improve invalid relocation error message"" · e3a845e2
      Sam Clegg authored
      See https://reviews.llvm.org/D59860
      
      The initial version of this change effected more than just the
      error message.  This version is scoped down to only effect the error
      itself.
      
      llvm-svn: 357328
      e3a845e2
    • Alina Sbirlea's avatar
      [MemorySSA] Temporary fix assert when reaching 0 limit. · c8d6e049
      Alina Sbirlea authored
      llvm-svn: 357327
      c8d6e049
    • Artem Dergachev's avatar
      [analyzer] Move taint API from ProgramState to a separate header. NFC. · 44551cf6
      Artem Dergachev authored
      It is now an inter-checker communication API, similar to the one that
      connects MallocChecker/CStringChecker/InnerPointerChecker: simply a set of
      setters and getters for a state trait.
      
      Differential Revision: https://reviews.llvm.org/D59861
      
      llvm-svn: 357326
      44551cf6
    • Artem Dergachev's avatar
      [analyzer] PR37501: Disable assertion for logical op short circuit evaluation. · 60cde76f
      Artem Dergachev authored
      The transfer function for the CFG element that represents a logical operation
      computes the value of the operation and does nothing else. The element
      appears after all the short circuit decisions were made, so they don't need
      to be made again at this point.
      
      Because our expression evaluation is imprecise, it is often hard to
      discriminate between:
      
        (1) we don't know the value of the RHS because we failed to evaluate it
      
      and
      
        (2) we don't know the value of the RHS because it didn't need to be evaluated.
      
      This is hard because it depends on our knowledge about the value of the LHS
      (eg., if LHS is true, then RHS in (LHS || RHS) doesn't need to be computed)
      but LHS itself may have been evaluated imprecisely and we don't know whether
      it is true or not. Additionally, the Analyzer wouldn't necessarily even remember
      what the value of the LHS was because theoretically it's not really necessary
      to know it for any future evaluations.
      
      In order to work around these issues, the transfer function for logical
      operations consists in looking at the ExplodedGraph we've constructed so far
      in order to figure out from which CFG direction did we arrive here.
      Such post-factum backtracking that doesn't involve looking up LHS and RHS values
      is usually possible. However sometimes it fails because when we deduplicate
      exploded nodes with the same program point and the same program state we may end
      up in a situation when we reached the same program point from two or more
      different directions.
      
      By removing the assertion, we admit that the procedure indeed sometimes fails to
      work. When it fails, we also admit that we don't know the value of the logical
      operator.
      
      Differential Revision: https://reviews.llvm.org/D59857
      
      llvm-svn: 357325
      60cde76f
    • Sanjoy Das's avatar
      Try to fix buildbot error · 53a5952a
      Sanjoy Das authored
      Error is:
      
      llvm/lib/Analysis/ScalarEvolution.cpp:3534:10: error: chosen constructor is explicit in copy-initialization
        return {UniqueSCEVs.FindNodeOrInsertPos(ID, IP), std::move(ID), IP};
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/bin/../lib/gcc/aarch64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
              constexpr tuple(_UElements&&... __elements)
                        ^
      1 error generated.
      
      llvm-svn: 357324
      53a5952a
    • Artem Dergachev's avatar
      [analyzer] Introduce a simplified API for adding custom path notes. · 6b39f10a
      Artem Dergachev authored
      Almost all path-sensitive checkers need to tell the user when something specific
      to that checker happens along the execution path but does not constitute a bug
      on its own. For instance, a call to operator delete in C++ has consequences
      that are specific to a use-after-free bug. Deleting an object is not a bug
      on its own, but when the Analyzer finds an execution path on which a deleted
      object is used, it'll have to explain to the user when exactly during that path
      did the deallocation take place.
      
      Historically such custom notes were added by implementing "bug report visitors".
      These visitors were post-processing bug reports by visiting every ExplodedNode
      along the path and emitting path notes whenever they noticed that a change that
      is relevant to a bug report occurs within the program state. For example,
      it emits a "memory is deallocated" note when it notices that a pointer changes
      its state from "allocated" to "deleted".
      
      The "visitor" approach is powerful and efficient but hard to use because
      such preprocessing implies that the developer first models the effects
      of the event (say, changes the pointer's state from "allocated" to "deleted"
      as part of operator delete()'s transfer function) and then forgets what happened
      and later tries to reverse-engineer itself and figure out what did it do
      by looking at the report.
      
      The proposed approach tries to avoid discarding the information that was
      available when the transfer function was evaluated. Instead, it allows the
      developer to capture all the necessary information into a closure that
      will be automatically invoked later in order to produce the actual note.
      
      This should reduce boilerplate and avoid very painful logic duplication.
      
      On the technical side, the closure is a lambda that's put into a special kind of
      a program point tag, and a special bug report visitor visits all nodes in the
      report and invokes all note-producing closures it finds along the path.
      
      For now it is up to the lambda to make sure that the note is actually relevant
      to the report. For instance, a memory deallocation note would be irrelevant when
      we're reporting a division by zero bug or if we're reporting a use-after-free
      of a different, unrelated chunk of memory. The lambda can figure these thing out
      by looking at the bug report object that's passed into it.
      
      A single checker is refactored to make use of the new functionality: MIGChecker.
      Its program state is trivial, making it an easy testing ground for the first
      version of the API.
      
      Differential Revision: https://reviews.llvm.org/D58367
      
      llvm-svn: 357323
      6b39f10a
    • Sam Clegg's avatar
      [libc++abi] Don't set POSITION_INDEPENDENT_CODE when building static library · 31a991ee
      Sam Clegg authored
      With the current WebAssembly backend, objects built with -fPIC are not
      compatible with static linking.  libc++abi was (mistakenly?) adding
      -fPIC to the objects it was including in a static library.
      
      IIUC this change should also mean the static build can be more efficient
      on all platforms.
      
      Differential Revision: https://reviews.llvm.org/D60005
      
      llvm-svn: 357322
      31a991ee
    • Thomas Lively's avatar
      [WebAssembly] Add mutable globals feature · 5f0c4c67
      Thomas Lively authored
      Summary:
      This feature is not actually used for anything in the WebAssembly
      backend, but adding it allows users to get it into the target features
      sections of their objects, which makes these objects
      future-compatible.
      
      Reviewers: aheejin, dschuff
      
      Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D60013
      
      llvm-svn: 357321
      5f0c4c67