1. Dec 02, 2014
    • Alexey Samsonov's avatar
      Add override specifiers to Symbolizer methods. NFC. · 4cdf4eba
      Alexey Samsonov authored
      llvm-svn: 223094
      4cdf4eba
    • Hal Finkel's avatar
      Simplify pointer comparisons involving memory allocation functions · afcd8dbb
      Hal Finkel authored
      System memory allocation functions, which are identified at the IR level by the
      noalias attribute on the return value, must return a pointer into a memory region
      disjoint from any other memory accessible to the caller. We can use this
      property to simplify pointer comparisons between allocated memory and local
      stack addresses and the addresses of global variables. Neither the stack nor
      global variables can overlap with the region used by the memory allocator.
      
      Fixes PR21556.
      
      llvm-svn: 223093
      afcd8dbb
    • Philip Reames's avatar
      Try to fix a bot failure due to a variable used only in an assert. · 8e302cdb
      Philip Reames authored
      Specifically, bot lld-x86_64-darwin13.  Resulting from change 223085.
      
      llvm-svn: 223092
      8e302cdb
    • Oleksiy Vyalov's avatar
      Fix several test failures on Linux/FreeBSD caused by compiler configuration... · a3ff6af4
      Oleksiy Vyalov authored
      Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms.
      http://reviews.llvm.org/D6392
      
      llvm-svn: 223091
      a3ff6af4
    • Nikola Smiljanic's avatar
      fce370eb
    • Zachary Turner's avatar
      Enable enabling and disabling breakpoints on Windows. · e0d93f52
      Zachary Turner authored
      llvm-svn: 223089
      e0d93f52
    • Zachary Turner's avatar
      Link test executables with LLD on Windows. · e068d918
      Zachary Turner authored
      Clang generates DWARF debug info with section names longer
      than 8 characters.  This is only supported by an extension
      to PE/COFF which the MSVC linker doesn't implement.  So
      trying to link DWARF-enabled object files with MSVC will
      lead to corrupt debug information in the executable.
      
      llvm-svn: 223088
      e068d918
    • Zachary Turner's avatar
      Only normalize FileSpec paths *after* resolving them. · c7a17ed4
      Zachary Turner authored
      Normalizing paths before resolving them can cause the path to
      become denormalized after resolution.
      
      llvm-svn: 223087
      c7a17ed4
    • Zachary Turner's avatar
      Make -fuse-ld=lld work properly on Windows. · 719f58c2
      Zachary Turner authored
      Using lld on Windows requires calling link-lld.exe instead of
      lld.exe.  This patch puts this knowledge into clang so that when
      using the GCC style clang driver, it can properly delegate to
      lld.
      
      Differential Revision: http://reviews.llvm.org/D6428
      Reviewed by: Reid Kleckner, Rui Ueyama
      
      llvm-svn: 223086
      719f58c2
    • Philip Reames's avatar
      [Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend · 0365f1a3
      Philip Reames authored
      This is the second patch in a small series.  This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints.  It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code.  I will be submitting the SelectionDAG parts within the next 24-48 hours.  Since those pieces are by far the most complicated, I wanted to minimize the size of that patch.  That patch will include the tests which exercise the functionality in this patch.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
      
      The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots.  The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes.  The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT.  (Doing so would break relocation semantics for collectors which wish to relocate roots.)
      
      The implementation of STATEPOINT is closely modeled on PATCHPOINT.  Eventually, much of the code in this patch will be removed.  The long term plan is to merge the functionality provided by statepoints and patchpoints.  Merging their implementations in the backend is likely to be a good starting point.
      
      Reviewed by: atrick, ributzka
      
      llvm-svn: 223085
      0365f1a3
    • Enrico Granata's avatar
      The register keyword is deprecated in C++11, so clang complains strongly about... · e2068207
      Enrico Granata authored
      The register keyword is deprecated in C++11, so clang complains strongly about swig generating register declarations. Abuse the preprocessor to define the keyword away
      
      llvm-svn: 223084
      e2068207
    • Greg Clayton's avatar
      lldb can deadlock when launched with an non-existing executable: · afa91e33
      Greg Clayton authored
      % lldb /bin/nonono
      (lldb) target create "/bin/nonono"
      error: unable to find executable for '/usr/bin/nonono'
      <deadlock>
      
      The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with:
      
      void
      CommandInterpreter::RunCommandInterpreter(bool auto_handle_events,
                                                bool spawn_thread,
                                                CommandInterpreterRunOptions &options)
      {
          // Always re-create the command intepreter when we run it in case
          // any file handles have changed.
          bool force_create = true;
          m_debugger.PushIOHandler(GetIOHandler(force_create, &options));
          m_stopped_for_crash = false;
          
          if (auto_handle_events)
              m_debugger.StartEventHandlerThread();
          
          if (spawn_thread)
          {
              m_debugger.StartIOHandlerThread();
          }
          else
          {
              m_debugger.ExecuteIOHanders();
              
              if (auto_handle_events)
                  m_debugger.StopEventHandlerThread();
          }
          
      }
      
      If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute:
      
      m_debugger.StartEventHandlerThread();
      m_debugger.ExecuteIOHanders();
      m_debugger.StopEventHandlerThread();
      
      
      The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do:
      
      void
      Debugger::StopEventHandlerThread()
      {
          if (m_event_handler_thread.IsJoinable())
          {
              GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived);
              m_event_handler_thread.Join(nullptr);
          }
      }
      
      The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet.
      
      The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition.
      
      This fixes radar:
      
      <rdar://problem/19041192>
      
      llvm-svn: 223083
      afa91e33
    • Greg Clayton's avatar
      Added a new regular expression to the "_regexp-break" command ("b" by default): · d90ac932
      Greg Clayton authored
      (lldb) b /break here/
      
      This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be:
      
      (lldb) breakpoint set --source-pattern-regexp 'break here'
      
      llvm-svn: 223082
      d90ac932
    • Vince Harron's avatar
      Added StringExtractor::DecodeHexU8 && GetHexBytesAvail · 6eddf8df
      Vince Harron authored
      DecodeHexU8 returns a decoded hex character pair, returns -1 if a
      valid hex pair is not available.
      
      GetHexBytesAvail decodes all available hex pairs.
      
      llvm-svn: 223081
      6eddf8df
    • Vince Harron's avatar
      StringExtractor unit tests · e5a9eaaa
      Vince Harron authored
      Unit tests to cover StringExtractor in advance of minor new
      functionality & minor refactor
      
      llvm-svn: 223080
      e5a9eaaa
    • Reid Kleckner's avatar
      Use nullptr to silence -Wsentinel when self-hosting on Windows · ee7cf84c
      Reid Kleckner authored
      Richard rejected my Sema change to interpret an integer literal zero in
      a varargs context as a null pointer, so -Wsentinel sees an integer
      literal zero and fires off a warning. Only CodeGen currently knows that
      it promotes integer literal zeroes in this context to pointer size on
      Windows.  I didn't want to teach -Wsentinel about that compatibility
      hack. Therefore, I'm migrating to C++11 nullptr.
      
      llvm-svn: 223079
      ee7cf84c
    • Philip Reames's avatar
      [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR Intrinsics · 337c4bd4
      Philip Reames authored
      The statepoint intrinsics are intended to enable precise root tracking through the compiler as to support garbage collectors of all types. The addition of the statepoint intrinsics to LLVM should have no impact on the compilation of any program which does not contain them. There are no side tables created, no extra metadata, and no inhibited optimizations.
      
      A statepoint works by transforming a call site (or safepoint poll site) into an explicit relocation operation. It is the frontend's responsibility (or eventually the safepoint insertion pass we've developed, but that's not part of this patch series) to ensure that any live pointer to a GC object is correctly added to the statepoint and explicitly relocated. The relocated value is just a normal SSA value (as seen by the optimizer), so merges of relocated and unrelocated values are just normal phis. The explicit relocation operation, the fact the statepoint is assumed to clobber all memory, and the optimizers standard semantics ensure that the relocations flow through IR optimizations correctly.
      
      This is the first patch in a small series.  This patch contains only the IR parts; the documentation and backend support will be following separately.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.
      
      Reviewed by: atrick, ributzka
      
      llvm-svn: 223078
      337c4bd4
    • Jingyue Wu's avatar
      [NVPTX] Do not emit .weak symbols for NVPTX · 5b62eb9b
      Jingyue Wu authored
      Summary:
      ".weak" symbols cannot be consumed by ptxas (PR21685). This patch makes the
      weak directive in MCAsmPrinter customizable, and disables emitting ".weak"
      symbols for NVPTX.
      
      Test Plan: weak-linkage.ll
      
      Reviewers: jholewinski
      
      Reviewed By: jholewinski
      
      Subscribers: majnemer, jholewinski, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6455
      
      llvm-svn: 223077
      5b62eb9b
    • Reid Kleckner's avatar
      Parse 'ghccc' in .ll files as the GHC convention (cc 10) · 35fc363c
      Reid Kleckner authored
      Previously we just used "cc 10" in the .ll files, but that isn't very
      human readable.
      
      llvm-svn: 223076
      35fc363c
    • Ahmed Bougacha's avatar
      [AArch64] Don't combine "select (setcc i1 LHS, RHS), vL, vR". · d0ce058f
      Ahmed Bougacha authored
      r208210 introduced an optimization that improves the vector select
      codegen by doing the setcc on vectors directly.
      This is a problem they the setcc operands are i1s, because the
      optimization would create vectors of i1, which aren't legal.
      
      Part of PR21549.
      
      Differential Revision: http://reviews.llvm.org/D6308
      
      llvm-svn: 223075
      d0ce058f
    • Ahmed Bougacha's avatar
      [AArch64] Fix v2i8->i16 bitcast legalization. · 87946320
      Ahmed Bougacha authored
      r213378 improved f16 bitcasts, so that they go directly through subregs,
      instead of through the stack.  That code now causes an assertion failure
      for bitcasts from other 16-bits types (most importantly v2i8).
      
      Correct that by doing the custom lowering for i16 bitcasts only when the
      input is an f16.
      
      Part of PR21549.
      
      Differential Revision: http://reviews.llvm.org/D6307
      
      llvm-svn: 223074
      87946320
    • Shankar Easwaran's avatar
      [Core] Remove function to not override RoundTripPasses. · 7a64ec24
      Shankar Easwaran authored
      RoundTripPasses should always be called in DEBUG mode if the environment
      variable "LLD_RUN_ROUNDTRIP_TEST" is set.
      
      Flavors should not be able to override this behavior.
      
      llvm-svn: 223073
      7a64ec24
    • Peter Zotov's avatar
      [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module. · 0d040f66
      Peter Zotov authored
      This way most code won't link this (substantially large) library,
      if compiled statically with LLVM.
      
      llvm-svn: 223072
      0d040f66
    • Peter Zotov's avatar
      [OCaml] [cmake] Add CMake buildsystem for OCaml. · b20073c6
      Peter Zotov authored
      Closes PR15325.
      
      llvm-svn: 223071
      b20073c6
    • JF Bastien's avatar
      libc++: add NaCl and PNaCl support for std::random_device · 57148cbc
      JF Bastien authored
      Summary:
      The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random.
      
      This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided).
      
      Test Plan: ninja check-libcxx
      
      Reviewers: dschuff, mclow.lists, danalbert
      
      Subscribers: jfb, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D6442
      
      llvm-svn: 223068
      57148cbc
    • Rafael Espindola's avatar
      Use a continue to reduce indentation and clang-format. NFC. · 973b3612
      Rafael Espindola authored
      llvm-svn: 223067
      973b3612
    • Rafael Espindola's avatar
      Use a range loop. NFC. · 4d4c9387
      Rafael Espindola authored
      llvm-svn: 223066
      4d4c9387
    • Richard Smith's avatar
      Add missing 'break's, found by inspection. No functionality change; the · a634ff21
      Richard Smith authored
      fallthrough happened to do the right thing in both cases.
      
      llvm-svn: 223064
      a634ff21
    • Pete Cooper's avatar
      Use C++ typed enums instead of 'unsigned char' for MCInst Kind. NFC. · 178e6548
      Pete Cooper authored
      This makes it much easier to see the value of operands in the debugger.
      
      llvm-svn: 223060
      178e6548
    • Ahmed Bougacha's avatar
      [MachineVerifier] Accept a MBB with a single landing pad successor. · fb6eeb74
      Ahmed Bougacha authored
      The MachineVerifier used to check that there was always exactly one
      unconditional branch to a non-landingpad (normal) successor.
      If that normal successor to an invoke BB is unreachable, it seems
      reasonable to only have one successor, the landing pad.
      On targets other than AArch64 (and on AArch64 with a different testcase),
      the branch folder turns the branch to the landing pad into a fallthrough.
      The MachineVerifier, which relies on AnalyzeBranch, is unable to check
      the condition, and doesn't complain. However, it does in this specific
      testcase, where the branch to the landing pad remained.
      Make the MachineVerifier accept it.
      
      llvm-svn: 223059
      fb6eeb74
    • Rafael Espindola's avatar
      Drop SrcStructTypesSet. It is redundant. · dd42b533
      Rafael Espindola authored
      At the only point in the code it is used, we haven't added any of the src types
      to DstStructTypesSet yet.
      
      llvm-svn: 223057
      dd42b533
    • Nico Weber's avatar
      Add a test for devirtualization of virtual operator calls. · 4af55faa
      Nico Weber authored
      There was no test coverage for this before: Modifiying
      EmitCXXOperatorMemberCallee() to not call CanDevirtualizeMemberFunctionCall()
      didn't make any test fail.
      
      llvm-svn: 223056
      4af55faa
    • Tim Northover's avatar
      ARM: lower tail calls correctly when using GHC calling convention. · 3024b553
      Tim Northover authored
      Patch by Ben Gamari.
      
      llvm-svn: 223055
      3024b553
    • Hans Wennborg's avatar
      Revert r223049, r223050 and r223051 while investigating test failures. · 5bef5b52
      Hans Wennborg authored
      I didn't foresee affecting the Clang test suite :/
      
      llvm-svn: 223054
      5bef5b52
    • Hans Wennborg's avatar
      SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable · 269ebb61
      Hans Wennborg authored
      They would get optimized away later, but we might as well not emit them.
      
      llvm-svn: 223051
      269ebb61
    • Hans Wennborg's avatar
      SimplifyCFG: don't remove unreachable default switch destinations · 5a1e5c05
      Hans Wennborg authored
      An unreachable default destination can be exploited by other optimizations, and
      SDag lowering is now prepared to handle them efficiently.
      
      For example, branches to the unreachable destination will be optimized away,
      such as in the case of range checks for switch lookup tables.
      
      On 64-bit Linux, this reduces the size of a clang bootstrap by 80 kB (and
      Chromium by 30 kB).
      
      llvm-svn: 223050
      5a1e5c05
    • Hans Wennborg's avatar
      SelectionDAG switch lowering: Replace unreachable default with most popular case. · 1571336f
      Hans Wennborg authored
      This can significantly reduce the size of the switch, allowing for more
      efficient lowering.
      
      I also worked with the idea of exploiting unreachable defaults by
      omitting the range check for jump tables, but always ended up with a
      non-neglible binary size increase. It might be worth looking into some more.
      
      llvm-svn: 223049
      1571336f
    • Matt Arsenault's avatar
      Update R600 address space map to include generic · bfe25b26
      Matt Arsenault authored
      llvm-svn: 223046
      bfe25b26
    • Rafael Espindola's avatar
      Partial revert of r222986. · a4e85e3d
      Rafael Espindola authored
      The explicit set of destination types is not fully redundant when lazy loading
      since the TypeFinder will not find types used only in function bodies.
      
      This keeps the logic to drop the name of mapped types since it still helps
      with avoiding further renaming.
      
      llvm-svn: 223043
      a4e85e3d
  2. Dec 01, 2014
    • Matt Arsenault's avatar
      R600/SI: Various instruction format bit test cleanups · c5f174d0
      Matt Arsenault authored
      - Fix missing SALU format bits
      - Remove unused isSALUInstr
      - Add isVALU
      - Switch isDS to use a bit like the others
      - Move SIInstrInfo::is* functions to header
      - Reorder so they are approximately sorted by type (SALU, VALU, memory)
      
      llvm-svn: 223038
      c5f174d0