1. Feb 12, 2016
  2. Feb 11, 2016
    • Eric Fiselier's avatar
    • Jun Bum Lim's avatar
      [InstCombine] Simplify a known nonzero incoming value of PHI · 339e9723
      Jun Bum Lim authored
      Summary:
      When a PHI is used only to be compared with zero, it is possible to replace an
      incoming value with any non-zero constant if the incoming value can be proved as
      a known nonzero value. For example, in below code, we can replace the incoming value %v with
      any non-zero constant based on the fact that the PHI is only used to be compared with zero
      and %v is a known non-zero value:
        %v = select %cond, 1, 2
        %p = phi [%v, BB] ...
        %c = icmp eq, %p, 0
      
      Reviewers: mcrosier, jmolloy, sanjoy
      
      Subscribers: hfinkel, mcrosier, majnemer, llvm-commits, haicheng, bmakam, mssimpso, gberry
      
      Differential Revision: http://reviews.llvm.org/D16240
      
      llvm-svn: 260530
      339e9723
    • Benjamin Kramer's avatar
      Drop the hidden visibility from DebugHandlerBase for now. · e3b963d5
      Benjamin Kramer authored
      If a class has hidden visibility all derived classes and all classes
      that have it as a member must have hidden visibility too. That may
      be fixable here but requires changes to quite a lot of debug info
      classes.
      
      This is also one of the things that GCC enforces aggressively while
      clang ignores it, making testing more annoying than necessary.
      
      llvm-svn: 260529
      e3b963d5
    • Rafael Espindola's avatar
      Sort includes. NFC. · 9d13d041
      Rafael Espindola authored
      llvm-svn: 260528
      9d13d041
    • Marshall Clow's avatar
      Add some tests to ensure that the __regex_word does not conflict with any of ctype_base's values. · 9b66ab75
      Marshall Clow authored
      Hopefully this will catch cases like https://llvm.org/bugs/show_bug.cgi?id=26476 in the future.
      
      llvm-svn: 260527
      9b66ab75
    • Eric Fiselier's avatar
      Properly down-cast a sentinal node pointer through void* · 8e39768c
      Eric Fiselier authored
      llvm-svn: 260526
      8e39768c
    • Aidan Dodds's avatar
      [Renderscript] Refactor target argument reading code. · f4786785
      Aidan Dodds authored
      This patch reworks the function argument reading code, allowing us to annotate arguments with their types.  The type/size information is needed to correctly parse arguments passed on the stack.
      
      llvm-svn: 260525
      f4786785
    • Eric Fiselier's avatar
      Fix r260515 - Correct typos in CMake changes · 7603e005
      Eric Fiselier authored
      llvm-svn: 260524
      7603e005
    • Chad Rosier's avatar
      [AArch64] Improve load/store optimizer to handle LDUR + LDR. · 00f9d23f
      Chad Rosier authored
      This patch allows the mixing of scaled and unscaled load/stores to form
      load/store pairs.
      
      This is a reapplication of r259812, which had an incorrect assert.  The
      test_stur_str_no_assert() test is a reduced version of the issue hit in
      the AArch64 self-host.
      
      PR24465
      
      llvm-svn: 260523
      00f9d23f
    • Rafael Espindola's avatar
      Revert "Bail on compilation as soon as a job fails." · 932b3198
      Rafael Espindola authored
      This reverts commit r260448.
      
      It was causing Driver/output-file-cleanup.c to fail.
      
      llvm-svn: 260522
      932b3198
    • Scott Egerton's avatar
      [MC] Fixed parsing of macro arguments where expressions with spaces are present. · a1fa68ac
      Scott Egerton authored
      Summary:
      Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction.
      The reason that the test case has been changed is so that the expected
      output matches the output of the GNU assembler.
      
      Reviewers: vkalintiris, dsanders
      
      Subscribers: dsanders, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D13592
      
      llvm-svn: 260521
      a1fa68ac
    • Artur Pilipenko's avatar
      Make context-sensitive isDereferenceable queries in isSafeToLoadUnconditionally · 66d6d3eb
      Artur Pilipenko authored
      This is a part of the refactoring to unify isSafeToLoadUnconditionally and isDereferenceablePointer functions. In the subsequent change isSafeToSpeculativelyExecute will be modified to use isSafeToLoadUnconditionally instead of isDereferenceableAndAlignedPointer.   
      
      Reviewed By: reames
      
      Differential Revision: http://reviews.llvm.org/D16227
      
      llvm-svn: 260520
      66d6d3eb
    • Andrey Bokhanko's avatar
      Partial revert of rL260506. · 5dfd5b65
      Andrey Bokhanko authored
      After some experiments I discovered that clang doesn't support static
      initialization of flexible array members in full, so restored this paragraph in
      "GCC extensions not implemented yet" list.
      
      llvm-svn: 260519
      5dfd5b65
    • Daniel Jasper's avatar
      clang-format: [JS] Support for (.. of ..) loops. · b7fda115
      Daniel Jasper authored
      Before:
        for (var i of[2, 3]) {}
      
      After:
        for (var i of [2, 3]) {}
      
      llvm-svn: 260518
      b7fda115
    • Daniel Jasper's avatar
      clang-format: Make indentation after "<<" more consistent. · 602a727a
      Daniel Jasper authored
      Before:
        Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
            << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      	  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
        Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
            << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      	     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
            << aaa;
      
      After:
        Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
            << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      	     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
        Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
            << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      	     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
            << aaa;
      
      llvm-svn: 260517
      602a727a
    • Eric Fiselier's avatar
      separate nested >> · daed67ff
      Eric Fiselier authored
      llvm-svn: 260516
      daed67ff
    • Vasileios Kalintiris's avatar
      Re-commit "Introduce a cmake module to figure out whether we need to link with libatomic." · d247ac44
      Vasileios Kalintiris authored
      This re-applies commit r260235. However, this time we add -gcc-toolchain
      to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN
      variable.
      
      llvm-svn: 260515
      d247ac44
    • Eric Fiselier's avatar
      Teach __hash_table how to handle unordered_map's __hash_value_type. · 45c4d45e
      Eric Fiselier authored
      This patch is fairly large and contains a number of changes. The main change
      is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
      this change is a rampant layering violation, but it's required to make
      unordered_map conforming without re-writing all of __hash_table.
      After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.
      
      The major changes found in this patch are:
      
        * Teach __hash_table to differentiate between the true container value type
          and the node value type by introducing the "__container_value_type" and
          "__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
          is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.
          
        * Switch almost all overloads in '__hash_table' previously taking 'value_type'
          (AKA '__node_value_type) to take  '__container_value_type' instead. Previously
          'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
          of the function signature.
          
        * Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
          '__key_value_types'. These functions allow '__hash_table' to unwrap
          '__node_value_type' objects into '__container_value_type' and its sub-parts.
      
        * Pass  '__hash_value_type::__value_'  to 'a.construct(p, ...)' instead of
          '__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
          and 'a.destroy()' are only ever instantiated for the containers value type.
      
        * Remove '__hash_value_type's constructors and destructors. We should never
          construct an instance of this type.
          (TODO this is UB but we already do it in plenty of places).
        
        * Add a generic "try-emplace" function to '__hash_table' called
          '__emplace_unique_key_args(Key const&, Args...)'.
      
        
      The following changes were done as cleanup:
      
        * Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
          '_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.
          
        * Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
          For example this patch removes the __construct_node overloads that do
          manual pack expansion.
          
        * Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
          resulting from the change. This includes almost all
          'unordered_map::__construct_node' overloads.
      
      
      The following changes are planed for future revisions:
      
        * Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
          '__emplace_unique_key_args'.
          
        * Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.
        
        * Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
          This prevent unneeded allocations when inserting duplicate entries.
      
      
      The additional follow up work needed after this patch:
      
        * Respect the lifetime rules for '__hash_value_type' by actually constructing it.
        * Make '__insert_multi' act similar to '__insert_unique' for objects of type
          'T&' and 'T const &&' with 'T = __container_value_type'.
        
        
      
      llvm-svn: 260514
      45c4d45e
    • Eric Fiselier's avatar
      Teach __hash_table how to handle unordered_map's __hash_value_type. · fcd02211
      Eric Fiselier authored
      This patch is fairly large and contains a number of changes. The main change
      is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
      this change is a rampant layering violation, but it's required to make
      unordered_map conforming without re-writing all of __hash_table.
      After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.
      
      The major changes found in this patch are:
      
        * Teach __hash_table to differentiate between the true container value type
          and the node value type by introducing the "__container_value_type" and
          "__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
          is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.
          
        * Switch almost all overloads in '__hash_table' previously taking 'value_type'
          (AKA '__node_value_type) to take  '__container_value_type' instead. Previously
          'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
          of the function signature.
          
        * Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
          '__key_value_types'. These functions allow '__hash_table' to unwrap
          '__node_value_type' objects into '__container_value_type' and its sub-parts.
      
        * Pass  '__hash_value_type::__value_'  to 'a.construct(p, ...)' instead of
          '__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
          and 'a.destroy()' are only ever instantiated for the containers value type.
      
        * Remove '__hash_value_type's constructors and destructors. We should never
          construct an instance of this type.
          (TODO this is UB but we already do it in plenty of places).
        
        * Add a generic "try-emplace" function to '__hash_table' called
          '__emplace_unique_key_args(Key const&, Args...)'.
      
        
      The following changes were done as cleanup:
      
        * Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
          '_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.
          
        * Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
          For example this patch removes the __construct_node overloads that do
          manual pack expansion.
          
        * Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
          resulting from the change. This includes almost all
          'unordered_map::__construct_node' overloads.
      
      
      The following changes are planed for future revisions:
      
        * Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
          '__emplace_unique_key_args'.
          
        * Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.
        
        * Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
          This prevent unneeded allocations when inserting duplicate entries.
      
      
      The additional follow up work needed after this patch:
      
        * Respect the lifetime rules for '__hash_value_type' by actually constructing it.
        * Make '__insert_multi' act similar to '__insert_unique' for objects of type
          'T&' and 'T const &&' with 'T = __container_value_type'.
        
        
      
      llvm-svn: 260513
      fcd02211
    • Omair Javaid's avatar
      Handle floating-point type homogeneous aggregate return values in ABISysV_arm · 62498ff8
      Omair Javaid authored
      For details refer to review link given below.
      
      Differential revision: http://reviews.llvm.org/D16975
      
      llvm-svn: 260512
      62498ff8
    • Tamas Berghammer's avatar
      Fix MSVC 2013 build after rL260504 · d12f3153
      Tamas Berghammer authored
      llvm-svn: 260511
      d12f3153
    • Denis Zobnin's avatar
      [MCU] Fix assertion failure on function returning empty union. · 380b2243
      Denis Zobnin authored
      Treat empty struct/union in return type as void for MCU ABI. PR26438.
      
      Differential Revision: http://reviews.llvm.org/D16808
      
      llvm-svn: 260510
      380b2243