1. 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
    • Artur Pilipenko's avatar
      Don't propagate dereferenceable attribute through gc.relocate in InstCombine · 44e7c51b
      Artur Pilipenko authored
      Reviewed By: reames
      
      Differential Revision: http://reviews.llvm.org/D16143
      
      llvm-svn: 260509
      44e7c51b
    • George Rimar's avatar
      [ELF] - Remove R_X86_64_GOTTPOFF from static relocation processing · 2960c986
      George Rimar authored
      R_X86_64_TPOFF64 is a dynamic relocation,
      it should not appear in static relocation processing.
      Patch fixes it.
      
      Differential revision: http://reviews.llvm.org/D16880
      
      llvm-svn: 260508
      2960c986
    • Andrey Turetskiy's avatar
      [X86] Enable the LEA optimization pass by default. · 193956e2
      Andrey Turetskiy authored
      Differential Revision: http://reviews.llvm.org/D16877
      
      llvm-svn: 260507
      193956e2
    • Andrey Bokhanko's avatar
      Update of "GCC extensions not implemented yet" in Clang User's Manual · e06d2ce3
      Andrey Bokhanko authored
      #pragma weak, global register variables and static initialization of flexible
      array members are supported now, so they are removed from "GCC extensions not
      implemented yet" list.
      
      Differential Revision: http://reviews.llvm.org/D16851
      
      llvm-svn: 260506
      e06d2ce3
    • Haojian Wu's avatar
      [clang-tidy] Fix an assert failure in 'readability-braces-around-statements' check. · 60c9316d
      Haojian Wu authored
      Summary:
      The check will trigger a assert failure("CondEndLoc.isValid") when
      checking the IfStmt whose condition expression is not parsed.
      
      In this case, we should ignore that.
      
      Reviewers: alexfh
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D17069
      
      llvm-svn: 260505
      60c9316d
    • Ashutosh Nema's avatar
      Fixed typo in comment & coding style for LoopVersioningLICM. · 2260a3a0
      Ashutosh Nema authored
      llvm-svn: 260504
      2260a3a0
    • Gabor Horvath's avatar
      [clang-tidy] Add a check to find unintended semicolons that changes the semantics. · 8b6434e5
      Gabor Horvath authored
      Reviewers: hokein, alexfh
      
      Differential Revision: http://reviews.llvm.org/D16535
      
      llvm-svn: 260503
      8b6434e5
    • Craig Topper's avatar
      [TableGen] Use range-based for loops. NFC · 6e2edc4b
      Craig Topper authored
      llvm-svn: 260502
      6e2edc4b
    • Craig Topper's avatar
    • Craig Topper's avatar
      [TableGen] Whitespace cleanup in output file. NFC · fc1b4d4d
      Craig Topper authored
      llvm-svn: 260500
      fc1b4d4d
    • Craig Topper's avatar
      [TableGen] Simplify code slightly. NFC · e16efd95
      Craig Topper authored
      llvm-svn: 260499
      e16efd95
    • Simon Atanasyan's avatar
      [MC][ELF] Handle MIPS specific .sdata and .sbss directives · be186204
      Simon Atanasyan authored
      MIPS specific .sdata and .sbss directives create corresponding sections
      with proper initialized ELF flags including ELF::SHF_MIPS_GPREL.
      
      Differential Revision: http://reviews.llvm.org/D17001
      
      llvm-svn: 260498
      be186204
    • Daniel Jasper's avatar
      clang-format: Make it more expensive to break template parameters. · 88db760e
      Daniel Jasper authored
      In particular, make it more expensive than breaking after the return
      type of a function definition/declaration.
      
      Before:
        template <typename T>
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
            T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
      
      After:
        template <typename T>
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
            aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
      
      llvm-svn: 260497
      88db760e
    • Akira Hatanaka's avatar
      [Objective-c] Stop attaching section "datacoal_nt" to global variables. · 7f550f3d
      Akira Hatanaka authored
      The current macho linker just copies symbols in section datacoal_nt to
      section data, so it doesn't really matter whether or not section
      "datacoal_nt" is attached to the global variable.
      
      This is a follow-up to r250370, which made changes in llvm to stop
      putting functions and data in the *coal* sections.
      
      rdar://problem/24528611
      
      llvm-svn: 260496
      7f550f3d
    • Matt Arsenault's avatar
      AMDGPU: Fix constant bus use check with subregisters · fcb345f1
      Matt Arsenault authored
      If the two operands to an instruction were both
      subregisters of the same super register, it would incorrectly
      think this counted as the same constant bus use.
      
      This fixes the verifier error in fmin_legacy.ll which
      was missing -verify-machineinstrs.
      
      llvm-svn: 260495
      fcb345f1
    • Matt Arsenault's avatar
      AMDGPU: Fix passes depending on dominator tree for no reason · 427c5489
      Matt Arsenault authored
      llvm-svn: 260494
      427c5489
    • Matt Arsenault's avatar
      AMDGPU: Remove some old intrinsic uses from tests · 9c47dd58
      Matt Arsenault authored
      llvm-svn: 260493
      9c47dd58
    • Alexey Bataev's avatar
      [OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC. · 4244be25
      Alexey Bataev authored
      OMPCapturedExprDecl allows caopturing not only of fielddecls, but also
      other expressions. It also allows to simplify codegen for several
      clauses.
      
      llvm-svn: 260492
      4244be25