1. Oct 15, 2015
    • Akira Hatanaka's avatar
      Revert r250349. · 276332b4
      Akira Hatanaka authored
      Test case coal-sections-powerpc.s is still failing on some buildbots.
      
      llvm-svn: 250351
      276332b4
    • Davide Italiano's avatar
      [JIT] TrivialMemoryManager: Fail if we can't allocate memory. · 89151a08
      Davide Italiano authored
      TrivialMemoryManager currently doesn't check the return type of AllocateRWX --
      and returns a 'null' MemoryBlock to its caller. As pointed out by Lang,
      this exposes some serious issues with the MemoryManager interface. There's,
      in fact, no way to report back an error to clients rather than aborting in
      case memory can't be allocated. Eventually the interface will grow to support
      this, but for now, fail sooner rather than later.
      
      Differential Revision:	http://reviews.llvm.org/D13627
      
      llvm-svn: 250350
      89151a08
    • Akira Hatanaka's avatar
      [MachO] Stop generating *coal* sections. · 1cea6441
      Akira Hatanaka authored
      Recommit r250342: add -arch=ppc32 to the RUN lines of powerpc tests.
      
      Some background on why we don't have to use *coal* sections anymore:
      Long ago when C++ was new and "weak" had not been standardized, an attempt was
      made in cctools to support C++ inlines that can be coalesced by putting them
      into their own section (TEXT/textcoal_nt instead of TEXT/text).
      
      The current macho linker supports the weak-def bit on any symbol to allow it to
      be coalesced, but the compiler still puts weak-def functions/data into alternate
      section names, which the linker must map back to the base section name.
      
      This patch makes changes that are necessary to prevent the compiler from using
      the "coal" sections and have it use the non-coal sections instead when the
      target architecture is not powerpc:
      
      TEXT/textcoal_nt instead use TEXT/text
      TEXT/const_coal instead use TEXT/const
      DATA/datacoal_nt instead use DATA/data
      
      If the target is powerpc, we continue to use the *coal* sections since anyone
      targeting powerpc is probably using an old linker that doesn't have support for
      the weak-def bits.
      
      Also, have the assembler issue a warning if it encounters a *coal* section in
      the assembly file and inform the users to use the non-coal sections instead.
      
      rdar://problem/14265330
      
      Differential Revision: http://reviews.llvm.org/D13188
      
      llvm-svn: 250349
      1cea6441
    • Craig Topper's avatar
      [X86] Use C+11 non-static data member initialization to initialize all the X86... · 543f3bdf
      Craig Topper authored
      [X86] Use C+11 non-static data member initialization to initialize all the X86 feature controls. NFC
      
      This simplifies the constructor initialization list and makes it less likely a feature flag will be forgotten there.
      
      llvm-svn: 250348
      543f3bdf
    • Rafael Espindola's avatar
      Remove silly getter use. · 39428e93
      Rafael Espindola authored
      It was creating a local var with the same name as the member var.
      
      llvm-svn: 250347
      39428e93
    • Akira Hatanaka's avatar
      Revert r250342. · d58d347e
      Akira Hatanaka authored
      Investigate why coal-sections-powerpc.s is failing on some buildbots.
      
      llvm-svn: 250346
      d58d347e
    • Cong Hou's avatar
      Update the branch weight metadata in JumpThreading pass. · b74d3b3b
      Cong Hou authored
      Currently in JumpThreading pass, the branch weight metadata is not updated after CFG modification. Consider the jump threading on PredBB, BB, and SuccBB. After jump threading, the weight on BB->SuccBB should be adjusted as some of it is contributed by the edge PredBB->BB, which doesn't exist anymore. This patch tries to update the edge weight in metadata on BB->SuccBB by scaling it by 1 - Freq(PredBB->BB) / Freq(BB->SuccBB).
      
      This is the third attempt to submit this patch, while the first two led to failures in some FDO tests. After investigation, it is the edge weight normalization that caused those failures. In this patch the edge weight normalization is fixed so that there is no zero weight in the output and the sum of all weights can fit in 32-bit integer. Several unit tests are added.
      
      Differential revision: http://reviews.llvm.org/D10979
      
      llvm-svn: 250345
      b74d3b3b
    • Philip Reames's avatar
      Test case which should have been part of 250343 · aae328d6
      Philip Reames authored
      llvm-svn: 250344
      aae328d6
    • Philip Reames's avatar
      [SimplifyCFG] Speculatively flatten CFG based on profiling metadata · b42db21d
      Philip Reames authored
      If we have a series of branches which are all unlikely to fail, we can possibly combine them into a single check on the fastpath combined with a bit of dispatch logic on the slowpath. We don't want to do this unconditionally since it requires speculating instructions past a branch, but if the profiling metadata on the branch indicates profitability, this can reduce the number of checks needed along the fast path.
      
      The canonical example this is trying to handle is removing the second bounds check implied by the Java code: a[i] + a[i+1]. Note that it can currently only do so for really simple conditions and the values of a[i] can't be used anywhere except in the addition. (i.e. the load has to have been sunk already and not prevent speculation.) I plan on extending this transform over the next few days to handle alternate sequences.
      
      Differential Revision: http://reviews.llvm.org/D13070
      
      llvm-svn: 250343
      b42db21d
    • Akira Hatanaka's avatar
      [MachO] Stop generating *coal* sections. · c078ae3e
      Akira Hatanaka authored
      Some background on why we don't have to use *coal* sections anymore:
      Long ago when C++ was new and "weak" had not been standardized, an attempt was
      made in cctools to support C++ inlines that can be coalesced by putting them
      into their own section (TEXT/textcoal_nt instead of TEXT/text).
      
      The current macho linker supports the weak-def bit on any symbol to allow it to
      be coalesced, but the compiler still puts weak-def functions/data into alternate
      section names, which the linker must map back to the base section name.
      
      This patch makes changes that are necessary to prevent the compiler from using
      the "coal" sections and have it use the non-coal sections instead when the
      target architecture is not powerpc:
      
      TEXT/textcoal_nt instead use TEXT/text
      TEXT/const_coal instead use TEXT/const
      DATA/datacoal_nt instead use DATA/data
      
      If the target is powerpc, we continue to use the *coal* sections since anyone
      targeting powerpc is probably using an old linker that doesn't have support for
      the weak-def bits.
      
      Also, have the assembler issue a warning if it encounters a *coal* section in
      the assembly file and inform the users to use the non-coal sections instead.
      
      rdar://problem/14265330
      
      Differential Revision: http://reviews.llvm.org/D13188
      
      llvm-svn: 250342
      c078ae3e
    • Enrico Granata's avatar
      Add a data formatter for __NSArray0, the type of empty arrays · bbf1da3c
      Enrico Granata authored
      llvm-svn: 250341
      bbf1da3c
    • Enrico Granata's avatar
      c3ef0ed5
    • Enrico Granata's avatar
      Fix a problem where LLDB could sometimes try to get the size of an Objective-C... · 95438038
      Enrico Granata authored
      Fix a problem where LLDB could sometimes try to get the size of an Objective-C type without passing an appropriate ExecutionContext
      
      llvm-svn: 250339
      95438038
    • Philip Reames's avatar
      Tighten known bits for ctpop based on zero input bits · ddcf6b35
      Philip Reames authored
      This is a cleaned up patch from the one written by John Regehr based on the findings of the Souper superoptimizer.
      
      The basic idea here is that input bits that are known zero reduce the maximum count that the intrinsic could return. We know that the number of bits required to represent a particular count is at most log2(N)+1.
      
      Differential Revision: http://reviews.llvm.org/D13253
      
      llvm-svn: 250338
      ddcf6b35
    • Rui Ueyama's avatar
      Simplify. · 690db678
      Rui Ueyama authored
      llvm-svn: 250337
      690db678
    • Eric Fiselier's avatar
      Update issues status · dfdf929a
      Eric Fiselier authored
      llvm-svn: 250336
      dfdf929a
    • Stephane Sezer's avatar
      Fix codesign command with cmake. · 86388ae7
      Stephane Sezer authored
      Summary:
      Looks like having a space in the Xcode path triggers this bug. We need
      to use cmake -E env FOO=bar [COMMAND] to set the environment instead.
      
      I am using cmake 3.3.1 and ninja 1.6.0 and I get this:
      
          [2681/2756] Linking CXX executable bin/debugserver
          FAILED: : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register -Wno-vla-extension  -fno-exceptions -fno-rtti -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wno-extended-offsetof -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,/Users/sas/Source/llvm/tools/lldb/tools/debugserver/source/../resources/lldb-debugserver-Info.plist tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/HasAVX.s.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFBundle.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFData.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFString.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/Genealogy.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachException.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachProcess.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachTask.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThread.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThreadList.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMMemory.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMRegion.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excServer.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excUser.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/debugserver_vers.c.o  -o bin/debugserver  lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/sas/Source/llvm/build/bin && "CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate" codesign --force --sign lldb_codesign debugserver
          /bin/sh: CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: No such file or directory
          [2681/2756] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o
          ninja: build stopped: subcommand failed.
      
      Reviewers: clayborg, dawn, brucem, tfiala
      
      Subscribers: lldb-commits
      
      Differential Revision: http://reviews.llvm.org/D13742
      
      llvm-svn: 250335
      86388ae7
    • Rui Ueyama's avatar
      ELF2: Support --entry=<addr>. · 2b675074
      Rui Ueyama authored
      If an argument for --entry is a number, that's not a symbol name but
      an absolute address. If that's the case, the address is directly set
      to ELF header's e_entry.
      
      llvm-svn: 250334
      2b675074
    • Chris Bieneman's avatar
      [CMake] Make LLVM_VERSION_* variables user definable · f9e0b253
      Chris Bieneman authored
      CMake's set command overwrites existing values. Package maintainers may want or need to set the version variables manually, so we need to only set them if they are not already defined. Note I use the "if(NOT DEFINED ...)" syntax deliberately in the last case because empty string is a valid value for the suffx, but not the other variables.
      
      llvm-svn: 250333
      f9e0b253
    • Sanjay Patel's avatar
      add x86 codegen tests for 'add nsw' followed by 'sext' · e2b52807
      Sanjay Patel authored
      llvm-svn: 250332
      e2b52807
    • Zachary Turner's avatar
      Make uses of /dev/null portable across OSes. · 4eff2d31
      Zachary Turner authored
      Most platforms have "/dev/null".  Windows has "nul".  Instead of
      hardcoding the string /dev/null at various places, make a constant
      that contains the correct value depending on the platform, and use
      that everywhere instead.
      
      llvm-svn: 250331
      4eff2d31
    • Rui Ueyama's avatar
      ELF2: Move Target concrete classes from .h to .cpp. · efc23de4
      Rui Ueyama authored
      llvm-svn: 250330
      efc23de4
    • Eric Fiselier's avatar
      Use correct CMake variable for the libname · 27dec399
      Eric Fiselier authored
      llvm-svn: 250329
      27dec399
    • Rui Ueyama's avatar
      ELF2: Remove {set,get}OutputSection accessors. · 80edbbbd
      Rui Ueyama authored
      These accessors didn't provide any additional value over a public
      member variable, too.
      
      llvm-svn: 250328
      80edbbbd
    • Zachary Turner's avatar
      Get Python unit tests working with Python 3. · 18426935
      Zachary Turner authored
      There were a couple of issues related to string handling that
      needed to be fixed.  In particular, we cannot get away with
      converting `PyUnicode` objects to `PyBytes` objects and storing
      the `PyBytes` regardless of Python version.  Instead we have to
      store a `PyUnicode` on Python 3 and a `PyString` on Python 2.
      
      The reason for this is that if you call `PyObject_Str` on a
      `PyBytes` in Python 3, it will return you a string that actually
      contains the string value wrappedin the characters b''.  So if we
      create a `PythonString` with the value "test", and we call Str()
      on it, we will get back the string "b'test'", which breaks string
      equality.  The only way to fix this is to store a native
      `PyUnicode` object under Python 3.
      
      With this CL, ScriptInterpreterPythonTests unit tests pass 100%
      under Python 2 and Python 3.
      
      llvm-svn: 250327
      18426935
    • Rui Ueyama's avatar
      ELF2: Remove {set,get}OutputSectionOff accessors. · edffd91b
      Rui Ueyama authored
      These accessors didn't provide any additional value over a public
      member variable.
      
      llvm-svn: 250326
      edffd91b
    • Eric Fiselier's avatar
      Link to new documentation from existing homepage · 9da4c8ed
      Eric Fiselier authored
      llvm-svn: 250325
      9da4c8ed
    • Bill Schmidt's avatar
      [PowerPC] Fix invalid lxvdsx optimization (PR25157) · 048cc97f
      Bill Schmidt authored
      PR25157 identifies a bug where a load plus a vector shuffle is
      incorrectly converted into an LXVDSX instruction.  That optimization
      is only valid if the load is of a doubleword, and in the noted case,
      it was not.  This corrects that problem.
      
      Joint patch with Eric Schweitz, who provided the bugpoint-reduced test
      case.
      
      llvm-svn: 250324
      048cc97f
    • Eric Fiselier's avatar
      Update testing guide for libc++ · 147bb89d
      Eric Fiselier authored
      llvm-svn: 250323
      147bb89d
    • Stephane Sezer's avatar
      Avoid a -Wreorder warning in ScriptInterpreterPython.cpp. · 76866446
      Stephane Sezer authored
      llvm-svn: 250322
      76866446
    • Davide Italiano's avatar
      [Bugpoint] Use 'CC' instead of 'GCC' for variable naming. · ab256219
      Davide Italiano authored
      We now use clang by default and fallback to gcc when requested.
      With this commit, names reflect reality. No functional change
      intended.
      
      Discussed with: Rafael Espindola.
      
      llvm-svn: 250321
      ab256219
    • Daniel Berlin's avatar
      [IDFCalculator] Use DominatorTreeBase instead of DominatorTree · 92b9ec3c
      Daniel Berlin authored
      Summary:
      IDFCalculator used a DominatorTree instance for its calculations. Since the PostDominatorTree struct is not a subclass of DominatorTree, it wasn't possible to use PDT in IDFCalculator to compute post-dominance frontiers.
      
      This patch makes IDFCalculator work with a DominatorTreeBase<BasicBlock> instead, which enables PDTs to be utilized.
      
      Patch by Victor Campos (vhscampos@gmail.com)
      
      Reviewers: dberlin
      
      Subscribers: dberlin, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D13725
      
      llvm-svn: 250320
      92b9ec3c
    • Eric Fiselier's avatar
      [libcxx] Make it drastically simpler to link libc++. · 8241405a
      Eric Fiselier authored
      Summary:
      Currently on most platforms you have to manually link the c++ abi library used with libc++ whenever you use libc++. So your typical libc++ command like invocation might look like:
      
      ```
      clang++ -stdlib=libc++ foo.cpp -lc++abi
      ```
      
      Having to manually link `libc++abi.so` makes it harder for libc++ to be used generically. This patch fixes that by generating a linker script for `libc++.so` that correctly links the ABI library. On linux the linker script for libc++abi would look like:
      
      ```
      # libc++.so
      INPUT(libc++.so.1 -lc++abi)
      ```
      
      With the linker script you can now use libc++ using only `-stdlib=libc++`. This is the technique that is used on FreeBSD in ordered to link cxxrt and I think it's the best approach to make our users lives simpler.
      
      The CMake option used to enable this is `LIBCXX_ENABLE_ABI_LINKER_SCRIPT`. In future I would like to enable this by default on all platforms except for Darwin.
      
      Reviewers: mclow.lists, danalbert, rsmith, jroelofs, EricWF
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D12508
      
      llvm-svn: 250319
      8241405a
    • Davide Italiano's avatar
      [Bugpoint] Use clang by default. · 8a5d0439
      Davide Italiano authored
      We now rely on gcc only if either of the following is true:
      1) -gcc option is passed by the user
      2) clang is not found in the default path.
      
      Differential Revision:	 http://reviews.llvm.org/D13642
      
      llvm-svn: 250318
      8a5d0439
    • Chen Li's avatar
      [LoopUnswitch] Correct misleading comments. · 567aa7ab
      Chen Li authored
      Reviewers: reames
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D13738
      
      llvm-svn: 250317
      567aa7ab
    • Eric Fiselier's avatar
      Fix LIBCXXABI_HAS_NO_THREADS configuration. · 3cf3cfc4
      Eric Fiselier authored
      llvm-svn: 250316
      3cf3cfc4
    • Rui Ueyama's avatar
      ELF2: Merge .{text,rodata,data,bss}.* sections. · 4fcadaf5
      Rui Ueyama authored
      Previously, we used input section names as output section names.
      That resulted that we created lots of sections for comdat
      or -f{function,data}-section sections.
      
      This patch reduces the number of sections by dropping suffix from
      all section names which start with ".text.", ".rodata.", ".data."
      or ".bss.". GNU linker does this using the internal linker script,
      but for LLD I chose to do that directly.
      
      Interestingly, this makes the linker faster. Time to link Clang
      is this.
      
      Before:
      
        real    0m0.537s
        user    0m0.433s
        sys     0m0.104s
      
      After:
      
        real    0m0.390s
        user    0m0.268s
        sys     0m0.120s
      
      It make sense because previously we created 57659 sections now only 27.
      
      llvm-svn: 250315
      4fcadaf5
    • Arch D. Robison's avatar
      Add 'other' in description of extractvalue operands. · a7f8f252
      Arch D. Robison authored
      llvm-svn: 250314
      a7f8f252
    • Eric Fiselier's avatar
      Configure for config site header · 035ddc20
      Eric Fiselier authored
      llvm-svn: 250313
      035ddc20
    • Eric Fiselier's avatar
      Split out config_site logic so libc++abi can use it · f71de32d
      Eric Fiselier authored
      llvm-svn: 250312
      f71de32d