1. Jan 08, 2018
    • Jonas Paulsson's avatar
      [SystemZ] Comment fix in SystemZElimCompare.cpp · 22f208f0
      Jonas Paulsson authored
      NFC
      
      Review: Ulrich Weigand
      llvm-svn: 321990
      22f208f0
    • Momchil Velikov's avatar
      [ARM] Fix PR35481 · d17dabca
      Momchil Velikov authored
      This patch allows `r7` to be used, regardless of its use as a frame pointer, as
      a temporary register when popping `lr`, and also falls back to using a high
      temporary register if, for some reason, we weren't able to find a suitable low
      one.
      
      Differential revision: https://reviews.llvm.org/D40961
      Fixes https://bugs.llvm.org/show_bug.cgi?id=35481
      
      llvm-svn: 321989
      d17dabca
    • Sam Parker's avatar
      [X86] Renamed CodeGen test · 51164c40
      Sam Parker authored
      llvm-svn: 321988
      51164c40
    • Francis Visoiu Mistrih's avatar
      [X86] Remove side-effects from determineCalleeSaves · d52da128
      Francis Visoiu Mistrih authored
      (Target)FrameLowering::determineCalleeSaves can be called multiple
      times. I don't think it should have side-effects as creating stack
      objects and setting global MachineFunctionInfo state as it is doing
      today (in other back-ends as well).
      
      This moves the creation of stack objects from determineCalleeSaves to
      assignCalleeSavedSpillSlots.
      
      Differential Revision: https://reviews.llvm.org/D41703
      
      llvm-svn: 321987
      d52da128
    • James Henderson's avatar
      [ELF] Compress debug sections after assignAddresses and support custom layout · e1689689
      James Henderson authored
      Previously, in r320472, I moved the calculation of section offsets and sizes
      for compressed debug sections into maybeCompress, which happens before
      assignAddresses, so that the compression had the required information. However,
      I failed to take account of relocations that patch such sections. This had two
      effects:
      
      1. A race condition existed when a debug section referred to a different debug
      section (see PR35788).
      2. References to symbols in non-debug sections would be patched incorrectly.
      This is because the addresses of such symbols are not calculated until after
      assignAddresses (this was a partial regression caused by r320472, but they
      could still have been broken before, in the event that a custom layout was used
      in a linker script).
      
      assignAddresses does not need to know about the output section size of
      non-allocatable sections, because they do not affect the value of Dot. This
      means that there is no longer a reason not to support custom layout of
      compressed debug sections, as far as I'm aware. These two points allow for
      delaying when maybeCompress can be called, removing the need for the loop I
      previously added to calculate the section size, and therefore the race
      condition. Furthermore, by delaying, we fix the issues of relocations getting
      incorrect symbol values, because they have now all been finalized.
      
      llvm-svn: 321986
      e1689689
    • Craig Topper's avatar
      [X86] Replace CVT2MASK ISD opcode with PCMPGTM compared to zero. · f090e8a8
      Craig Topper authored
      CVT2MASK is just checking the sign bit which can be represented with a comparison with zero.
      
      llvm-svn: 321985
      f090e8a8
    • Craig Topper's avatar
      [X86] Add patterns to allow 512-bit BWI compare instructions to be used for... · a2018e79
      Craig Topper authored
      [X86] Add patterns to allow 512-bit BWI compare instructions to be used for 128/256-bit compares when VLX is not available.
      
      llvm-svn: 321984
      a2018e79
    • Shoaib Meenai's avatar
      [COFF] Initalize ErrorHandler with CanExitEarly value · fd3e4b0e
      Shoaib Meenai authored
      Previously, the COFF driver would call exit(1) from the
      ErrorHandler in the case of a link error, even if
      CanExitEarly=false was specified. Now it initializes
      the ErrorHandler in the same way that the ELF driver does.
      
      Patch by Andrew Kelley.
      
      Differential Revision: https://reviews.llvm.org/D41803
      
      llvm-svn: 321983
      fd3e4b0e
    • Shoaib Meenai's avatar
      [ELF] Drop unnecessary VersionId setting in scanShlibUndefined · 3a15fb59
      Shoaib Meenai authored
      LLD previously used to handle dynamic lists and version scripts in the
      exact same way, even though they have very different semantics for
      shared libraries and subtly different semantics for executables. r315114
      untangled their semantics for executables (building on previous work to
      correct their semantics for shared libraries). With that change, dynamic
      lists won't set the default version to VER_NDX_LOCAL, and so resetting
      the version to VER_NDX_GLOBAL in scanShlibUndefined is unnecessary.
      
      This was causing an issue because version scripts containing `local: *`
      work by setting the default version to VER_NDX_LOCAL, but scanShlibUndefined
      would override this default, and therefore symbols which should have
      been local would end up in the dynamic symbol table, which differs from
      both bfd and gold's behavior. gold silently keeps the symbol hidden in
      such a scenario, whereas bfd issues an error. I prefer bfd's behavior
      and plan to implement that in LLD in a follow-up (and the test case
      added here will be updated accordingly).
      
      Differential Revision: https://reviews.llvm.org/D41639
      
      llvm-svn: 321982
      3a15fb59
    • Petr Hosek's avatar
      Don't try to run MCJIT/OrcJIT EH tests when C++ library is statically linked · 66aea6eb
      Petr Hosek authored
      These tests assumes availability of external symbols provided by the
      C++ library, but those won't be available in case when the C++ library
      is statically linked because lli itself doesn't need these.
      
      This uses llvm-readobj -needed-libs to check if C++ library is linked as
      shared library and exposes that information as a feature to lit.
      
      Differential Revision: https://reviews.llvm.org/D41272
      
      llvm-svn: 321981
      66aea6eb
    • Petr Hosek's avatar
      [llvm-readobj] Support -needed-libs option for Mach-O files · b3f80226
      Petr Hosek authored
      This implements the -needed-libs option in Mach-O dumper.
      
      Differential Revision: https://reviews.llvm.org/D41527
      
      llvm-svn: 321980
      b3f80226
    • Craig Topper's avatar
      [X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's... · 9f5859e3
      Craig Topper authored
      [X86] Simplify some code in lower1BitVectorShuffle by relying on getNode's ability to constant fold vector SIGN_EXTEND.
      
      llvm-svn: 321979
      9f5859e3
    • Craig Topper's avatar
      [X86] Add VSHUFF32X4 and similar instructions to load folding tables. · 03d8e516
      Craig Topper authored
      llvm-svn: 321978
      03d8e516
    • Richard Smith's avatar
      Remove bogus check for template specialization from self-comparison warning. · db70052b
      Richard Smith authored
      The important check is that we're not within a template *instantiation*, which
      we check separately.
      
      llvm-svn: 321977
      db70052b
    • Richard Smith's avatar
      Fix a couple of wrong self-comparison diagnostics. · 07c0f285
      Richard Smith authored
      Check whether we are comparing the same entity, not merely the same
      declaration, and don't assume that weak declarations resolve to distinct
      entities.
      
      llvm-svn: 321976
      07c0f285
    • Davide Italiano's avatar
      Revert "[SCCP] Manually fold branches on undef." · e15bffe9
      Davide Italiano authored
      I thought this was responsible for PR35723, but I was
      wrong, the issue lies elsewhere. Revert while I debug.
      
      llvm-svn: 321975
      e15bffe9
    • Davide Italiano's avatar
      [SLPVectorizer] Reintroduce std::stable_sort(properlyDominates()). · 4c39758a
      Davide Italiano authored
      The approach was never discussed, I wasn't able to reproduce this
      non-determinism, and the original author went AWOL.
      After a discussion on the ML, Philip suggested to revert this.
      
      llvm-svn: 321974
      4c39758a
    • Richard Smith's avatar
      Add tests for three-way self- and array comparison. · 32f39731
      Richard Smith authored
      llvm-svn: 321973
      32f39731
    • Richard Smith's avatar
      Factor out common tautological comparison code from scalar and vector compare checking. · abbb8ada
      Richard Smith authored
      In passing, improve vector compare diagnostic to match scalar compare diagnostic.
      
      llvm-svn: 321972
      abbb8ada
    • Craig Topper's avatar
      [X86] Revert accidental change to CMakeLists.txt in r321952 · e9f44e1b
      Craig Topper authored
      I had removed the qualifiers around the autogenerated folding table so I could compare with the manual table, but didn't intend to commit the change.
      
      llvm-svn: 321971
      e9f44e1b
    • Zvi Rackover's avatar
      X86 Tests: Add Tests for PMADDWD selection. NFC. · 93b8bd49
      Zvi Rackover authored
      Support for ISel to be added.
      
      llvm-svn: 321970
      93b8bd49
    • Simon Pilgrim's avatar
      [DAG] Fix for Bug PR34620 - Allow SimplifyDemandedBits to look through bitcasts · 998180da
      Simon Pilgrim authored
      Allow SimplifyDemandedBits to use TargetLoweringOpt::computeKnownBits to look through bitcasts. This can help simplifying in some cases where bitcasts of constants generated during or after legalization can't be folded away, and thus didn't get picked up by SimplifyDemandedBits. This fixes PR34620, where a redundant pand created during legalization from lowering and lshr <16xi8> wasn't being simplified due to the presence of a bitcasted build_vector as an operand.
      
      Committed on the behalf of @sameconrad (Sam Conrad)
      
      Differential Revision: https://reviews.llvm.org/D41643
      
      llvm-svn: 321969
      998180da
    • Craig Topper's avatar
      [X86] Remove unneeded code from combineGatherScatter that used to delte... · c1ec57c3
      Craig Topper authored
      [X86] Remove unneeded code from combineGatherScatter that used to delte SIGN_EXTEND_INREG nodes created during legalization of v2i1/v4i1 masks on KNL.
      
      v2i1/v4i1 are now legal on KNL so no sign_extend_inreg is generated.
      
      llvm-svn: 321968
      c1ec57c3
    • Craig Topper's avatar
      [X86] Make v2i1 and v4i1 legal types without VLX · d58c1655
      Craig Topper authored
      Summary:
      There are few oddities that occur due to v1i1, v8i1, v16i1 being legal without v2i1 and v4i1 being legal when we don't have VLX. Particularly during legalization of v2i32/v4i32/v2i64/v4i64 masked gather/scatter/load/store. We end up promoting the mask argument to these during type legalization and then have to widen the promoted type to v8iX/v16iX and truncate it to get the element size back down to v8i1/v16i1 to use a 512-bit operation. Since need to fill the upper bits of the mask we have to fill with 0s at the promoted type.
      
      It would be better if we could just have the v2i1/v4i1 types as legal so they don't undergo any promotion. Then we can just widen with 0s directly in a k register. There are no real v4i1/v2i1 instructions anyway. Everything is done on a larger register anyway.
      
      This also fixes an issue that we couldn't implement a masked vextractf32x4 from zmm to xmm properly.
      
      We now have to support widening more compares to 512-bit to get a mask result out so new tablegen patterns got added.
      
      I had to hack the legalizer for widening the operand of a setcc a bit so it didn't try create a setcc returning v4i32, extract from it, then try to promote it using a sign extend to v2i1. Now we create the setcc with v4i1 if the original setcc's result type is v2i1. Then extract that and don't sign extend it at all.
      
      There's definitely room for improvement with some follow up patches.
      
      Reviewers: RKSimon, zvi, guyblank
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41560
      
      llvm-svn: 321967
      d58c1655
    • Marshall Clow's avatar
    • Jonas Hahnfeld's avatar
      Correct types of pointers to doacross_num_done · 3ffca790
      Jonas Hahnfeld authored
      This field is defined as kmp_int32, so we should use neither
      pointers to kmp_int64 nor 64 bit atomic instructions.
      (Found while testing on a Raspberry Pi, 32 bit ARM)
      
      Differential Revision: https://reviews.llvm.org/D41656
      
      llvm-svn: 321964
      3ffca790
    • Dimitry Andric's avatar
      Add pre-C++11 is_constructible wrappers for 3 arguments · 672f7adc
      Dimitry Andric authored
      Summary:
      After rL319736 for D28253 (which fixes PR28929), gcc cannot compile `<memory>` anymore in pre-C+11 modes, complaining:
      
      ```
      In file included from /usr/include/c++/v1/memory:648:0,
                       from test.cpp:1:
      /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::make_shared(_A0&, _A1&, _A2&)':
      /usr/include/c++/v1/memory:4365:5: error: wrong number of template arguments (4, should be at least 1)
           static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" );
           ^
      In file included from /usr/include/c++/v1/memory:649:0,
                       from test.cpp:1:
      /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
       struct _LIBCPP_TEMPLATE_VIS is_constructible
                                   ^~~~~~~~~~~~~~~~
      In file included from /usr/include/c++/v1/memory:648:0,
                       from test.cpp:1:
      /usr/include/c++/v1/memory:4365:5: error: template argument 1 is invalid
           static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" );
           ^
      /usr/include/c++/v1/memory: In static member function 'static std::__1::shared_ptr<_Tp> std::__1::shared_ptr<_Tp>::allocate_shared(const _Alloc&, _A0&, _A1&, _A2&)':
      /usr/include/c++/v1/memory:4444:5: error: wrong number of template arguments (4, should be at least 1)
           static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" );
           ^
      In file included from /usr/include/c++/v1/memory:649:0,
                       from test.cpp:1:
      /usr/include/c++/v1/type_traits:3198:29: note: provided for 'template<class _Tp, class _A0, class _A1> struct std::__1::is_constructible'
       struct _LIBCPP_TEMPLATE_VIS is_constructible
                                   ^~~~~~~~~~~~~~~~
      In file included from /usr/include/c++/v1/memory:648:0,
                       from test.cpp:1:
      /usr/include/c++/v1/memory:4444:5: error: template argument 1 is invalid
           static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" );
           ^
      ```
      
      This is also reported in https://bugs.freebsd.org/224946 (FreeBSD is apparently one of the very few projects that regularly builds programs against libc++ with gcc).
      
      The reason is that the static assertions are invoking `is_constructible` with three arguments, while gcc does not have the built-in `is_constructible` feature, and the pre-C++11 `is_constructible` wrappers in `<type_traits>` only provide up to two arguments.
      
      I have added additional wrappers for three arguments, modified the `is_constructible` entry point to take three arguments instead, and added a simple test to is_constructible.pass.cpp.
      
      Reviewers: EricWF, mclow.lists
      
      Reviewed By: EricWF
      
      Subscribers: krytarowski, cfe-commits, emaste
      
      Differential Revision: https://reviews.llvm.org/D41805
      
      llvm-svn: 321963
      672f7adc
    • Hal Finkel's avatar
      [LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp · 0f1314c5
      Hal Finkel authored
      Another small step forward to move VPlan stuff outside of LoopVectorize.cpp.
      
      VPlanBuilder.h is renamed to LoopVectorizationPlanner.h
      LoopVectorizationPlanner class is moved from LoopVectorize.cpp to
      LoopVectorizationPlanner.h LoopVectorizationCostModel::VectorizationFactor
      class is moved to LoopVectorizationPlanner.h (used by the planner class) ---
      this needs further streamlining work in later patches and thus all I did was
      take it out of the CostModel class and moved to the header file.  The callback
      function had to stay inside LoopVectorize.cpp since it calls an
      InnerLoopVectorizer member function declared in it.  Next Steps: Make
      InnerLoopVectorizer, LoopVectorizationCostModel, and other classes more modular
      and more aligned with VPlan direction, in small increments.
      
      Previous step was: r320900 (https://reviews.llvm.org/D41045)
      
      Patch by Hideki Saito, thanks!
      
      Differential Revision: https://reviews.llvm.org/D41420
      
      llvm-svn: 321962
      0f1314c5
  2. Jan 07, 2018