1. Aug 09, 2016
  2. Aug 08, 2016
    • Tobias Grosser's avatar
      [IslNodeBuilder] Move run-time check generation to NodeBuilder [NFC] · 0aa29532
      Tobias Grosser authored
      This improves the structure of the code and allows us to reuse the runtime
      code generation in the PPCGCodeGeneration.
      
      llvm-svn: 278017
      0aa29532
    • Oliver Stannard's avatar
      [ARM] Command-line options for embedded position-independent code · 218c4cbd
      Oliver Stannard authored
      This patch (with the corresponding ARM backend patch) adds support for
      some new relocation models:
      
      * Read-only position independence (ROPI): Code and read-only data is accessed
        PC-relative. The offsets between all code and RO data sections are known at
        static link time.
      * Read-write position independence (RWPI): Read-write data is accessed relative
        to a static base register. The offsets between all writeable data sections
        are known at static link time.
      
      These two modes are independent (they specify how different objects
      should be addressed), so they can be used individually or together.
      
      These modes are intended for bare-metal systems or systems with small
      real-time operating systems. They are designed to avoid the need for a
      dynamic linker, the only initialisation required is setting the static
      base register to an appropriate value for RWPI code.
      
      There is one C construct not currently supported by these modes: global
      variables initialised to the address of another global variable or
      function, where that address is not known at static-link time. There are
      a few possible ways to solve this:
      
      * Disallow this, and require the user to write their own initialisation
        function if they need variables like this.
      * Emit dynamic initialisers for these variables in the compiler, called from
        the .init_array section (as is currently done for C++ dynamic initialisers).
        We have a patch to do this, described in my original RFC email
        (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the
        feedback from that RFC thread was that this is not something that belongs in
        clang.
      * Use a small dynamic loader to fix up these variables, by adding the
        difference between the load and execution address of the relevant section.
        This would require linker co-operation to generate a table of addresses that
        need fixing up.
      
      Differential Revision: https://reviews.llvm.org/D23196
      
      llvm-svn: 278016
      218c4cbd
    • Oliver Stannard's avatar
      [ARM] Add support for embedded position-independent code · 8331aaee
      Oliver Stannard authored
      This patch adds support for some new relocation models to the ARM
      backend:
      
      * Read-only position independence (ROPI): Code and read-only data is accessed
        PC-relative. The offsets between all code and RO data sections are known at
        static link time. This does not affect read-write data.
      * Read-write position independence (RWPI): Read-write data is accessed relative
        to the static base register (r9). The offsets between all writeable data
        sections are known at static link time. This does not affect read-only data.
      
      These two modes are independent (they specify how different objects
      should be addressed), so they can be used individually or together. They
      are otherwise the same as the "static" relocation model, and are not
      compatible with SysV-style PIC using a global offset table.
      
      These modes are normally used by bare-metal systems or systems with
      small real-time operating systems. They are designed to avoid the need
      for a dynamic linker, the only initialisation required is setting r9 to
      an appropriate value for RWPI code.
      
      I have only added support to SelectionDAG, not FastISel, because
      FastISel is currently disabled for bare-metal targets where these modes
      would be used.
      
      Differential Revision: https://reviews.llvm.org/D23195
      
      llvm-svn: 278015
      8331aaee
    • Tobias Grosser's avatar
      [CodeGeneration] Do not set insert position redundantly · 219feac4
      Tobias Grosser authored
      There is no need to reset the position of the builder, as we can just continue
      to insert code at the current position of the IRBuilder, which happens to
      be precisely the location we reset the builder to.
      
      llvm-svn: 278014
      219feac4
    • Tobias Grosser's avatar
      [IslNodeBuilder] Directly use the insert location of our Builder · 000db707
      Tobias Grosser authored
      ... instead of adding instructions at the end of the basic block the builder
      is currently at. This makes it easier to reason about where IR is generated,
      as with the IRBuilder there is just a single location that specificies where
      IR is generated.
      
      llvm-svn: 278013
      000db707
    • Zhan Jun Liau's avatar
      [SystemZ] Add support for the .insn directive · 4fbc3f4a
      Zhan Jun Liau authored
      Summary:
      Add support for the .insn directive.
      
      .insn is an s390 specific directive that allows encoding of an instruction
      instead of using a mnemonic. The motivating case is some code in node.js that
      requires support for the .insn directive.
      
      Reviewers: koriakin, uweigand
      
      Subscribers: koriakin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D21809
      
      llvm-svn: 278012
      4fbc3f4a
    • Nico Weber's avatar
      Revert r2277979. · eb912b9d
      Nico Weber authored
      For some reason, MSVC2013's cl.exe crashes with
        fatal error C1001: An internal error has occurred in the compiler
      with this when compiling e.g. LoopDistribute.cpp.
      
      llvm-svn: 278011
      eb912b9d
    • Sebastian Pop's avatar
      GVN-hoist: enable by default · bfb96c5b
      Sebastian Pop authored
      llvm-svn: 278010
      bfb96c5b
    • Artur Pilipenko's avatar
      [LVI] NFC. On the fast dest path use inverse predicate instead of inverse range result · eed618d5
      Artur Pilipenko authored
      Gathering constantins from a condition on the false path ask makeAllowedICmpRegion about inverse predicate instead of inversing the resulting range.
      
      This change was separated from the review "[LVI] Make LVI smarter about comparisons with non-constants" (https://reviews.llvm.org/D23205#inline-198361)
      
      llvm-svn: 278009
      eed618d5
    • Artur Pilipenko's avatar
      [LVI] NFC. Rename confusing local NegOffset to Offset · 54b50cc1
      Artur Pilipenko authored
      NegOffset is not necessarily negative
      
      llvm-svn: 278008
      54b50cc1
    • Artur Pilipenko's avatar
      21472910
    • Gabor Horvath's avatar
      [analyzer] Command line option to show enabled checker list. · c430990d
      Gabor Horvath authored
      This patch adds a command line option to list the checkers that were enabled
      by analyzer-checker and not disabled by -analyzer-disable-checker.
      
      It can be very useful to debug long command lines when it is not immediately
      apparent which checkers are turned on and which checkers are turned off.
      
      Differential Revision: https://reviews.llvm.org/D23060
      
      llvm-svn: 278006
      c430990d
    • Pavel Labath's avatar
      Fix uninitialized field warnings in GDBRemoteRegisterContext · 142f4f76
      Pavel Labath authored
      also take the opportunity to replace NULL with nullptr and add clang-format guards to prevent it
      from messing up the nice table there.
      
      llvm-svn: 278005
      142f4f76
    • Eric Liu's avatar
      Fixes calculateRangesAfterReplacements crash when Replacements is empty. · 73337f3d
      Eric Liu authored
      Reviewers: klimek, djasper
      
      Subscribers: cfe-commits, klimek
      
      Differential Revision: https://reviews.llvm.org/D23264
      
      llvm-svn: 278004
      73337f3d
    • Jonas Hahnfeld's avatar
      kmp_gsupport: Fix library initialization with taskgroup · ad0c42e3
      Jonas Hahnfeld authored
      Differential Revision: https://reviews.llvm.org/D23259
      
      llvm-svn: 278003
      ad0c42e3
    • Silviu Baranga's avatar
      [AArch64] PR28877: Don't assume we're running after legalization when creating vcvtfp2fxs · fa00ba3c
      Silviu Baranga authored
      Summary:
      The DAG combine transformation that was generating the
      aarch64_neon_vcvtfp2fxs node was assuming that all
      inputs where legal and wasn't accounting that the input
      could be a v4f64 if we're trying to do the transformation
      before legalization. We now bail out in this case.
      
      All illegal types besides v4f64 were already rejected.
      
      Fixes https://llvm.org/bugs/show_bug.cgi?id=28877.
      
      Reviewers: jmolloy
      
      Subscribers: aemerson, rengolin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23261
      
      llvm-svn: 278002
      fa00ba3c
    • Pavel Labath's avatar
      Clean up linux/Ptrace.h · 4ec22ec6
      Pavel Labath authored
      This removes references to PT_XXX macros from the file, as they were not used anyway. It also
      changes the macro used to check for the definition of __ptrace_request, as there are other C
      libraries which do not define this type.
      
      llvm-svn: 278001
      4ec22ec6
    • Pavel Labath's avatar
      Remove Android.h · 1eb0d42a
      Pavel Labath authored
      It only contained a reimplementation of std::to_string, which I have replaced with usages of
      pre-existing llvm::to_string (also, injecting members into the std namespace is evil).
      
      llvm-svn: 278000
      1eb0d42a
    • Pavel Labath's avatar
      Remove SYS_tgkill from Android.h · c923a3dc
      Pavel Labath authored
      instead, use __NR_tgkill directly, which seems to be the preferred form in the codebase anyway.
      
      llvm-svn: 277999
      c923a3dc
    • Pavel Labath's avatar
      Remove _isatty from Android.h · 6b734568
      Pavel Labath authored
      it is just #defined to isatty anyway, which lldb already knows how to use.
      
      llvm-svn: 277997
      6b734568
    • Jonas Hahnfeld's avatar
      Mark tests with task dependencies as unsupported with GCC · ca32babf
      Jonas Hahnfeld authored
      llvm-svn: 277996
      ca32babf
    • Daniel Sanders's avatar
      Re-commit r277988: [mips][ias] Fix all the hacks related to MIPS-specific... · 3feeb9c8
      Daniel Sanders authored
      Re-commit r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
      
      Hopefully with the MSVC builds fixed. I've added a missing '#include <tuple>'
      that gcc and clang don't seem to need.
      
      llvm-svn: 277995
      3feeb9c8
    • Simon Pilgrim's avatar
      Fix Wdocumentation unknown parameter warning · 4981ec9a
      Simon Pilgrim authored
      llvm-svn: 277994
      4981ec9a
    • Simon Pilgrim's avatar
      [X86][SSE] Assert if the shuffle mask indices are not -1 or within a valid input range · 33fc7883
      Simon Pilgrim authored
      As discussed in post-review rL277959
      
      llvm-svn: 277993
      33fc7883
    • Jonas Hahnfeld's avatar
      Do not block on explicit task depending on proxy task · bedc371c
      Jonas Hahnfeld authored
      Consider the following code:
      
          int dep;
          #pragma omp target nowait depend(out: dep)
          {
              sleep(1);
          }
          #pragma omp task depend(in: dep)
          {
              printf("Task with dependency\n");
          }
          printf("Doing some work...\n");
      
      In its current state the runtime will block on the second task and not
      continue execution.
      
      Differential Revision: https://reviews.llvm.org/D23116
      
      llvm-svn: 277992
      bedc371c
    • Jonas Hahnfeld's avatar
      __kmp_free_task: Fix for serial explicit tasks producing proxy tasks · 69f8511f
      Jonas Hahnfeld authored
      Consider the following code which may be executed by a serial team:
      
          int dep;
          #pragma omp target nowait depend(out: dep)
          {
              sleep(1);
          }
          #pragma omp task depend(in: dep)
          {
              #pragma omp target nowait
              {
                  sleep(1);
              }
          }
      
      Here the explicit task may not be freed until the nested proxy task has
      finished. The current code hasn't considered this and called __kmp_free_task
      anyway which triggered an assert because of remaining incomplete children:
      
          KMP_DEBUG_ASSERT( TCR_4(taskdata->td_incomplete_child_tasks) == 0 );
      
      Differential Revision: https://reviews.llvm.org/D23115
      
      llvm-svn: 277991
      69f8511f
    • Daniel Sanders's avatar
      Revert r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary... · cae9aeed
      Daniel Sanders authored
      Revert r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.).
      
      It seems that MSVC doesn't like std::tie().
      
      llvm-svn: 277990
      cae9aeed
    • Gabor Horvath's avatar
      [analyzer] Model base to derived casts more precisely. · 44583ce6
      Gabor Horvath authored
      Dynamic casts are handled relatively well by the static analyzer.
      BaseToDerived casts however are treated conservatively. This can cause some
      false positives with the NewDeleteLeaks checker.
      
      This patch alters the behavior of BaseToDerived casts. In case a dynamic cast
      would succeed use the same semantics. Otherwise fall back to the conservative
      approach.
      
      Differential Revision: https://reviews.llvm.org/D23014
      
      llvm-svn: 277989
      44583ce6
    • Daniel Sanders's avatar
      [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.). · 2ab623b5
      Daniel Sanders authored
      Summary:
      They are now lexed as a single token on targets where
      MCAsmInfo::HasMipsExpressions is true and then parsed in a similar way to
      the '~' operator as part of MCExpr::parseExpression.
      
      As a result:
      * expressions and immediates no longer have different parsing rules. The
        difference is now solely down to whether evaluateAsAbsolute() succeeds.
      * %hi(%neg(%gp_rel(x))) are no longer parsed as a single operator and
        decomposed into the three MipsMCExpr nodes. They are parsed directly as
        three MipsMCExpr nodes.
        * parseMemOperand no longer needs to eat all the surrounding parenthesis
          to get at the outermost operator to make this work
      * %hi(%neg(%gp_rel(x))) and %lo(%neg(%gp_rel(x))) are no longer the only
        3-in-1 relocs that parse for N64. They're still the only combinations that
        are permitted in relocatable expressions though. Fixing that should be a
        later patch.
      * We no longer need to list all the tokens that can occur as the first token of
        an expression or immediate.
      
      test/MC/Mips/expr1.s:
          This change also prevents the incorrect lowering of %lo(2*4)+foo to
          %lo(8+foo) which is not an equivalent expression (the difference is
          whether foo is truncated to 16-bit or not) and the test has been
          updated to account for the macro expansion the correct expression requires.
      
      Reviewers: sdardis
      
      Subscribers: dsanders, sdardis, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23110
      
      llvm-svn: 277988
      2ab623b5
    • Diana Picus's avatar
      [SelectionDAG] Refactor visitInlineAsm a bit. NFCI. · 4dd6c249
      Diana Picus authored
      This shaves off ~100 lines from visitInlineAsm.
      
      llvm-svn: 277987
      4dd6c249