1. Jul 14, 2015
    • Andrew Wilkins's avatar
      Add capability to get and set the personalitty function from the C API · 3bdfc1cd
      Andrew Wilkins authored
      Summary:
      The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem.
      
      Note that the whole thing could be avoided by improving the C API testing, as started by D10725
      
      Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw
      
      Subscribers: rafael, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D10946
      
      llvm-svn: 242104
      3bdfc1cd
    • Chris Bieneman's avatar
      [CMake] Forgot to quote the first part of STREQUAL. · d36f614e
      Chris Bieneman authored
      llvm-svn: 242103
      d36f614e
    • Chris Bieneman's avatar
      [CMake] We shouldn't be storing values in the cache unless they actually need CMake cache behavior. · 3da1b6e2
      Chris Bieneman authored
      add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable.
      
      This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior.
      
      There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days.
      
      llvm-svn: 242102
      3da1b6e2
    • Chaoren Lin's avatar
      Refactor Unix signals. · 98d0a4b3
      Chaoren Lin authored
      Summary:
      - Consolidate Unix signals selection in UnixSignals.
      - Make Unix signals available from platform.
      - Add jSignalsInfo packet to retrieve Unix signals from remote platform.
      - Get a copy of the platform signal for each remote process.
      - Update SB API for signals.
      - Update signal utility in test suite.
      
      Reviewers: ovyalov, clayborg
      
      Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits
      
      Differential Revision: http://reviews.llvm.org/D11094
      
      llvm-svn: 242101
      98d0a4b3
    • Rafael Espindola's avatar
      Add a herper function. NFC. · 2b05416b
      Rafael Espindola authored
      llvm-svn: 242100
      2b05416b
    • Adrian Prantl's avatar
      Remove a completely redundant initialization of llvm::TimePassesIsEnabled, · 5fe5b90b
      Adrian Prantl authored
      which is actually the variable backing up the llvm -time-passes command
      line argument.
      llvm::TimePassesIsEnabled is actually being initialized in CodeGenAction.
      
      llvm-svn: 242099
      5fe5b90b
    • Michael J. Spencer's avatar
      Fix warnings. · 50ed5308
      Michael J. Spencer authored
      llvm-svn: 242098
      50ed5308
    • Evgeniy Stepanov's avatar
      Basic code generation for MSan use-after-dtor. · 7cacbe4d
      Evgeniy Stepanov authored
      Under the -fsanitize-memory-use-after-dtor (disabled by default) insert
      an MSan runtime library call at the end of every destructor.
      
      Patch by Naomi Musgrave.
      
      llvm-svn: 242097
      7cacbe4d
    • Rafael Auler's avatar
      [LinkerScript] Don't create unnecessarily large segments · 2c4af3ea
      Rafael Auler authored
      When using a linker script expression to change the address of a section, even
      if the new address is more than a page of distance from the old address, lld
      may put everything in the same segment, forcing it to be unnecessarily large.
      This patch changes the logic in Segment::assignVirtualAddress() and
      Segment::assignFileOffsets() to allow the segment to be sliced into two or more
      if it detects a linker script expression that changes a section address.
      
      Differential Revision: http://reviews.llvm.org/D10952
      
      llvm-svn: 242096
      2c4af3ea
    • Alex Lorenz's avatar
      MIR Serialization: Serialize the variable sized stack objects. · 418f3ec1
      Alex Lorenz authored
      llvm-svn: 242095
      418f3ec1
    • Richard Smith's avatar
    • Michael J. Spencer's avatar
      Put explicit template instantiations in the correct namespace. · f754b1fe
      Michael J. Spencer authored
      llvm-svn: 242093
      f754b1fe
    • Michael J. Spencer's avatar
      Remove commented out code. · 64661cdb
      Michael J. Spencer authored
      llvm-svn: 242092
      64661cdb
    • Reid Kleckner's avatar
      Update enforceKnownAlignment after the isWeakForLinker semantic change · 486fa397
      Reid Kleckner authored
      Previously we would refrain from attempting to increase the linkage of
      available_externally globals because they were considered weak for the
      linker. Now they are treated more like a declaration instead of a weak
      definition.
      
      This was causing SSE alignment faults in Chromuim, when some code
      assumed it could increase the alignment of a dllimported global that it
      didn't control.  http://crbug.com/509256
      
      llvm-svn: 242091
      486fa397
    • Samuel Antao's avatar
      [OpenMP] Add REQUIRES pragma to threadprivate regression tests. · 3e1ccbe8
      Samuel Antao authored
      llvm-svn: 242090
      3e1ccbe8
    • Rafael Auler's avatar
      [LinkerScript] Fix bug in Segment::assignVirtualAddress() · a4917f74
      Rafael Auler authored
      When calculating the start address and size of a segment, lld mistakenly
      attributed the start address of the last segment slice to the whole segment
      when it should consider the start address of the first slice. In this case, in a
      multi-slice segment, Segment::assignVirtualAddress() will return a wrong
      segment start address to TargetLayout::assignVirtualAddress(). The effect of
      this miscalculation is to allocate some program headers in unnecessarily far
      away addresses. This commit fixes this.
      
      Differential Revision: http://reviews.llvm.org/D10951
      
      llvm-svn: 242089
      a4917f74
    • Michael J. Spencer's avatar
      Initial ELF port. · 8a414541
      Michael J. Spencer authored
      This is a direct port of the new PE/COFF linker to ELF.
      
      It can take a single object file and generate a valid executable that executes at the first byte in the text section.
      
      llvm-svn: 242088
      8a414541
    • David Majnemer's avatar
      [Intrin.h] Use __ATOMIC_SEQ_CST instead of '5' · e0b863f4
      David Majnemer authored
      No functionality change is intended.
      
      llvm-svn: 242087
      e0b863f4
    • David Majnemer's avatar
      [Intrin.h] Make the variable names more consistent · 56e46674
      David Majnemer authored
      No functionality change intended.
      
      llvm-svn: 242086
      56e46674
    • Artem Belevich's avatar
      [cuda] Driver changes to compile and stitch together host and device-side CUDA code. · 0ff05cd1
      Artem Belevich authored
        NOTE: reverts r242077 to reinstate r242058, r242065, 242067
              and includes fix for OS X test failures.
      
        - Changed driver pipeline to compile host and device side of CUDA
          files and incorporate results of device-side compilation into host
          object file.
      
        - Added a test for cuda pipeline creation in clang driver.
      
        New clang options:
        --cuda-host-only   - Do host-side compilation only.
        --cuda-device-only - Do device-side compilation only.
      
        --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
          compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
          than once in which case one device-compilation will be done per
          unique specified GPU architecture.
      
        Differential Revision: http://reviews.llvm.org/D9509
      
      llvm-svn: 242085
      0ff05cd1
    • Alex Lorenz's avatar
      MIR Serialization: Serialize the sub register indices. · 2eacca86
      Alex Lorenz authored
      This commit serializes the sub register indices from the register machine
      operands.
      
      Reviewers: Duncan P. N. Exon Smith
      llvm-svn: 242084
      2eacca86
    • Rafael Espindola's avatar
      Add missing file. · 8c1a9102
      Rafael Espindola authored
      Sorry about that.
      
      llvm-svn: 242083
      8c1a9102
    • Rafael Espindola's avatar
      Fix reading archive members with / in the name. · c60d0d2a
      Rafael Espindola authored
      This is important for thin archives.
      
      llvm-svn: 242082
      c60d0d2a
    • Bill Schmidt's avatar
      [PPC64LE] More improvements to VSX swap optimization · 15deb803
      Bill Schmidt authored
      This patch allows VSX swap optimization to succeed more frequently.
      Specifically, it is concerned with common code sequences that occur
      when copying a scalar floating-point value to a vector register.  This
      patch currently handles cases where the floating-point value is
      already in a register, but does not yet handle loads (such as via an
      LXSDX scalar floating-point VSX load).  That will be dealt with later.
      
      A typical case is when a scalar value comes in as a floating-point
      parameter.  The value is copied into a virtual VSFRC register, and
      then a sequence of SUBREG_TO_REG and/or COPY operations will convert
      it to a full vector register of the class required by the context.  If
      this vector register is then used as part of a lane-permuted
      computation, the original scalar value will be in the wrong lane.  We
      can fix this by adding a swap operation following any widening
      SUBREG_TO_REG operation.  Additional COPY operations may be needed
      around the swap operation in order to keep register assignment happy,
      but these are pro forma operations that will be removed by coalescing.
      
      If a scalar value is otherwise directly referenced in a computation
      (such as by one of the many XS* vector-scalar operations), we
      currently disable swap optimization.  These operations are
      lane-sensitive by definition.  A MentionsPartialVR flag is added for
      use in each swap table entry that mentions a scalar floating-point
      register without having special handling defined.
      
      A common idiom for PPC64LE is to convert a double-precision scalar to
      a vector by performing a splat operation.  This ensures that the value
      can be referenced as V[0], as it would be for big endian, whereas just
      converting the scalar to a vector with a SUBREG_TO_REG operation
      leaves this value only in V[1].  A doubleword splat operation is one
      form of an XXPERMDI instruction, which takes one doubleword from a
      first operand and another doubleword from a second operand, with a
      two-bit selector operand indicating which doublewords are chosen.  In
      the general case, an XXPERMDI can be permitted in a lane-swapped
      region provided that it is properly transformed to select the
      corresponding swapped values.  This transformation is to reverse the
      order of the two input operands, and to reverse and complement the
      bits of the selector operand (derivation left as an exercise to the
      reader ;).
      
      A new test case that exercises the scalar-to-vector and generalized
      XXPERMDI transformations is added as CodeGen/PowerPC/swaps-le-5.ll.
      The patch also requires a change to CodeGen/PowerPC/swaps-le-3.ll to
      use CHECK-DAG instead of CHECK for two independent instructions that
      now appear in reverse order.
      
      There are two small unrelated changes that are added with this patch.
      First, the XXSLDWI instruction was incorrectly omitted from the list
      of lane-sensitive instructions; this is now fixed.  Second, I observed
      that the same webs were being rejected over and over again for
      different reasons.  Since it's sufficient to reject a web only once, I
      added a check for this to speed up the compilation time slightly.
      
      llvm-svn: 242081
      15deb803
    • Samuel Antao's avatar
      [OpenMP] Add TLS-based implementation for threadprivate directive. · f8b5012d
      Samuel Antao authored
      llvm-svn: 242080
      f8b5012d
    • Adrian McCarthy's avatar
      Fix Windows build break related to MainLoop. · 6c40c5e0
      Adrian McCarthy authored
      llvm-svn: 242079
      6c40c5e0
    • Rui Ueyama's avatar
      COFF: Fix x86 delay-load helper function name. · 6d24908f
      Rui Ueyama authored
      If /delayload option is given, we have to resolve __delayLoadHelper2
      since the function is the dynamic loader to delay-load DLLs.
      The function name is mangled in x86 as ___delayLoadHelper2@8.
      
      llvm-svn: 242078
      6d24908f
    • Rafael Espindola's avatar
      This reverts commit r242058, r242065, r242067. · abbd6d68
      Rafael Espindola authored
      The tests were failing on OS X.
      
      Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code."
      Revert "Fixed regex to properly match '64' in the test case."
      Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least."
      
      llvm-svn: 242077
      abbd6d68
    • Greg Clayton's avatar
      3ca8f429
    • Rui Ueyama's avatar
      COFF: Inline Defined::getRVA because it's very hot. · cb71c72c
      Rui Ueyama authored
      llvm-svn: 242075
      cb71c72c
    • Rafael Espindola's avatar
      Use std::make_tuple to reduce code duplication. · 45592c64
      Rafael Espindola authored
      Thanks to David Blaikie for the suggestion.
      
      llvm-svn: 242074
      45592c64
    • Pete Cooper's avatar
      Remove unnecessary lines from the test in r242068. · 1a550c0a
      Pete Cooper authored
      This test case was breaking the hexagon elf bot.  The failing lines
      were actually unnecessary as checking that the store still reads the
      correct value demonstrates that everything is working fine now.
      
      llvm-svn: 242073
      1a550c0a
    • Nico Weber's avatar
      Reduce memory usage of ComputeEditDistance() by (almost) 50% · 18dcf48a
      Nico Weber authored
      ComputeEditDistance() currently keeps two rows of the edit distance matrix in
      memory.  That's unnecessary, one row plus one additional element are sufficient.
      With this change, strings up to 64 chars can be processed without going to the
      heap, compared to 32 chars previously.  (But the main motivation is that the
      code gets a bit simpler.)
      
      No intended behavior change.
      
      llvm-svn: 242069
      18dcf48a
    • Pete Cooper's avatar
      Loop idiom recognizer was replacing too many uses of popcount. · 90d95edb
      Pete Cooper authored
      When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop.
      
      The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed
      
       %tobool.5 = icmp ne i32 %num, 0
       store i1 %tobool.5, i1* %ptr
       br i1 %tobool.5, label %for.body.lr.ph, label %for.end
      
      to
      
       store i1 %1, i1* %ptr
       %0 = call i32 @llvm.ctpop.i32(i32 %num)
       %1 = icmp ne i32 %0, 0
       br i1 %1, label %for.body.lr.ph, label %for.end
      
      Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect.  The store doesn’t want the result of ctpop.
      
      The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses.
      
      Reviewed by Hal Finkel.
      
      llvm-svn: 242068
      90d95edb
    • NAKAMURA Takumi's avatar
      clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least. · 7227a88f
      NAKAMURA Takumi authored
      llvm-svn: 242067
      7227a88f
    • Rui Ueyama's avatar
      COFF: Split createSymbolAndSymbolTable to small functions. NFC. · e59a530a
      Rui Ueyama authored
      llvm-svn: 242066
      e59a530a
    • Artem Belevich's avatar
      Fixed regex to properly match '64' in the test case. · e9a400e0
      Artem Belevich authored
      llvm-svn: 242065
      e9a400e0
    • Benjamin Kramer's avatar
      Move class into an anonymous namespace. NFC. · 8b851d07
      Benjamin Kramer authored
      llvm-svn: 242064
      8b851d07
    • Reid Kleckner's avatar
      [WinEH] Emit the LSDA even if no lpads remain but outlining occurred · 9a1a9194
      Reid Kleckner authored
      The outlined funclets call intrinsics which reference labels from the
      LSDA. This situation can easily arise in small functions with a single
      cleanup at -O0, where Clang marks a definition as nounwind, and then
      WinEHPrepare "discovers" that the landingpad is dead by accident and
      deletes it.
      
      We now need to ask the LLVM IR Function for it's personality directly,
      rather than going through MachineModuleInfo.
      
      Fixes PR23892.
      
      llvm-svn: 242063
      9a1a9194
    • Benjamin Kramer's avatar
      [Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications · d8861517
      Benjamin Kramer authored
      No functional change intended.
      
      llvm-svn: 242062
      d8861517