1. Feb 11, 2017
    • David Blaikie's avatar
      Fix memory leak by using unique_ptr · a67cf000
      David Blaikie authored
      llvm-svn: 294823
      a67cf000
    • Peter Collingbourne's avatar
      Address Mehdi's post-commit review comments on r294795. · fa3175f2
      Peter Collingbourne authored
      llvm-svn: 294822
      fa3175f2
    • Evgeny Stupachenko's avatar
      Fix PR23384 (under "-lsr-insns-cost" option) · fe6f548d
      Evgeny Stupachenko authored
      Summary:
      The patch adds instructions number generated by a solution
       to LSR cost under "-lsr-insns-cost" option.
      
      Reviewers: qcolombet, hfinkel
      
      Differential Revision: http://reviews.llvm.org/D28307
      
      From: Evgeny Stupachenko <evstupac@gmail.com>
      llvm-svn: 294821
      fe6f548d
    • Benjamin Kramer's avatar
      Update XFAIL line after r294781. · a05bdf75
      Benjamin Kramer authored
      llvm-svn: 294820
      a05bdf75
    • Ahmed Bougacha's avatar
      [ARM] Make f16 interleaved accesses expensive. · 8425f453
      Ahmed Bougacha authored
      There are no vldN/vstN f16 variants, even with +fullfp16.
      We could use the i16 variants, but, in practice, even with +fullfp16,
      the f16 sequence leading to the i16 shuffle usually gets scalarized.
      We'd need to improve our support for f16 codegen before getting there.
      
      Teach the cost model to consider f16 interleaved operations as
      expensive.  Otherwise, we are all but guaranteed to end up with
      a large block of scalarized vector code.
      
      llvm-svn: 294819
      8425f453
    • Ahmed Bougacha's avatar
      [ARM] Don't lower f16 interleaved accesses. · fc979dc9
      Ahmed Bougacha authored
      There are no vldN/vstN f16 variants, even with +fullfp16.
      We could use the i16 variants, but, in practice, even with +fullfp16,
      the f16 sequence leading to the i16 shuffle usually gets scalarized.
      We'd need to improve our support for f16 codegen before getting there.
      
      Reject f16 interleaved accesses.  If we try to emit the f16 intrinsics,
      we'll just end up with a selection failure.
      
      llvm-svn: 294818
      fc979dc9
    • Ahmed Bougacha's avatar
      [ARM] Unique some redundant CHECK lines. NFC. · f37fb89e
      Ahmed Bougacha authored
      llvm-svn: 294817
      f37fb89e
    • Rafael Espindola's avatar
      Create only one section symbol per section. · 08d6a3f1
      Rafael Espindola authored
      Unfortunately some consumers of our .o files produced with -r expect
      only one section symbol per section. That is true of at least of go's
      own linker.
      
      Combining them is a somewhat convoluted process. We have to create a
      symbol for every section since we don't know which ones will be
      needed. The relocation sections also have to be written first to
      handle the Elf_Rel addend.
      
      I did consider a completely different approach:
      
      We could remove the -r special case of relocation sections when
      reading. We would instead have a copyRelocs function that is used
      instead of scanRelocs. It would create a DynamicReloc for each
      relocation and a RelocationSection for each input relocation section.
      
      A complication of such change is that DynamicReloc would have to take
      a section index and a input section instead of a symbol since with
      -emit-relocs some DynamicReloc would hold relocations referring to the
      dynamic symbol table and other to the static symbol table.
      
      That would be a pretty big change, and if we do it it is probably
      better to do it as a refactoring.
      
      llvm-svn: 294816
      08d6a3f1
    • Richard Trieu's avatar
      Move test include file from include/ to Inputs/ · f11ab87b
      Richard Trieu authored
      The Inputs/ directory is the recommended location for extra files for test
      cases.  No functional change.
      
      llvm-svn: 294815
      f11ab87b
    • Wei Mi's avatar
      [LSR] Recommit: Allow formula containing Reg for SCEVAddRecExpr related with outerloop. · 8f20e63a
      Wei Mi authored
      The recommit includes some changes of testcases. No functional change to the patch.
      
      In RateRegister of existing LSR, if a formula contains a Reg which is a SCEVAddRecExpr,
      and this SCEVAddRecExpr's loop is an outerloop, the formula will be marked as Loser
      and dropped.
      
      Suppose we have an IR that %for.body is outerloop and %for.body2 is innerloop. LSR only
      handle inner loop now so only %for.body2 will be handled.
      
      Using the logic above, formula like
      reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) will be dropped
      no matter what because reg({1,+, %size}<%for.body>) is a SCEVAddRecExpr type reg related
      with outerloop. Only formula like
      reg(%array) + 1*reg({{1,+, %size}<%for.body>,+,1}<nuw><nsw><%for.body2>) will be kept
      because the SCEVAddRecExpr related with outerloop is folded into the initial value of the
      SCEVAddRecExpr related with current loop.
      
      But in some cases, we do need to share the basic induction variable
      reg{0 ,+, 1}<%for.body2> among LSR Uses to reduce the final total number of induction
      variables used by LSR, so we don't want to drop the formula like
      reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) unconditionally.
      
      From the existing comment, it tries to avoid considering multiple level loops at the same time.
      However, existing LSR only handles innermost loop, so for any SCEVAddRecExpr with a loop other
      than current loop, it is an invariant and will be simple to handle, and the formula doesn't have
      to be dropped.
      
      Differential Revision: https://reviews.llvm.org/D26429
      
      llvm-svn: 294814
      8f20e63a
    • Eugene Zelenko's avatar
    • NAKAMURA Takumi's avatar
      sancov.py: [Py3] Use sys.stdout.buffer for bytes. · a2eb926e
      NAKAMURA Takumi authored
      This is part of https://reviews.llvm.org/D27405
      
      llvm-svn: 294812
      a2eb926e
    • Matthias Braun's avatar
      config-ix.cmake: Search for CMAKE_XCRUN before using it. · 59797ecc
      Matthias Braun authored
      This was previously searched in CMakeLists.txt unconditionally but as of
      r294371 it is only searched in some circumstances. Repeating the search
      in config-ix.cmake to make this robust and hopefully fix the macOS
      Asan+Ubsan jenkins build.
      
      llvm-svn: 294811
      59797ecc
    • Chandler Carruth's avatar
      [PM] Fix a bug in how I ported LoopDeletion to the new PM. · 027340f3
      Chandler Carruth authored
      This was marking the loop for deletion after the loop was deleted. This
      almost works, except that when we do any kind of debug logging it starts
      reading the name of the loop from deleted memory or otherwise blowing
      up. This can fail in a bunch of ways. I recently added a test that
      *always* does this, and it started failing on the sanitizer bots.
      
      The fix is to mark the loop as deleted in the loop PM infrastructure
      before we remove the loop. We can do this by passing the updater into
      the routine. That also lets us simplify a bunch of other interface
      components here for a net win.
      
      llvm-svn: 294810
      027340f3
    • Dan Gohman's avatar
      [WebAssembly] Remove old experimental disassemler code. · dfe6ce7a
      Dan Gohman authored
      Remove support for disassembling an old experimental wasm binary format, which
      is no longer in use anywhere.
      
      llvm-svn: 294809
      dfe6ce7a
    • Saleem Abdulrasool's avatar
      vim: add `returned` keyword · 769b98d3
      Saleem Abdulrasool authored
      The `returned` keyword was added in SVN r179925.  Update the vim syntax
      rules.
      
      llvm-svn: 294808
      769b98d3
    • Davide Italiano's avatar
      [LTO] Share the optimization remarks setup between Thin/Full LTO. · 690ed9de
      Davide Italiano authored
      llvm-svn: 294807
      690ed9de
    • Dimitry Andric's avatar
      Remove struct_rtentry_sz on FreeBSD · c18de741
      Dimitry Andric authored
      Summary:
      Since struct rtentry is an internal kernel-only structure on FreeBSD,
      and SIOCADDRT and SIOCDELRT are not supported anyway, stop including
      socketvar.h and attempting to get at the definition of struct rtentry,
      and move the line with struct_rtentry_sz to the SANIZER_LINUX block.
      
      Reviewers: kcc, kutuzov.viktor.84, emaste
      
      Reviewed By: kcc, emaste
      
      Subscribers: emaste, llvm-commits, kubamracek
      
      Differential Revision: https://reviews.llvm.org/D29832
      
      llvm-svn: 294806
      c18de741
    • Krzysztof Parzyszek's avatar
      [Hexagon] Introduce Hexagon V62 · f9015e62
      Krzysztof Parzyszek authored
      llvm-svn: 294805
      f9015e62
    • Greg Clayton's avatar
      Fix the lldb_private::Function::GetDescription to print out the name and... · b663010f
      Greg Clayton authored
      Fix the lldb_private::Function::GetDescription to print out the name and mangled name correctly. Previously this was getting the function type's name which was not correct.
      
      This info appears in the output of "image lookup --verbose --address ADDRESS".
      
      llvm-svn: 294804
      b663010f
    • Richard Smith's avatar
      541cf97f
    • Davide Italiano's avatar
      [tests] Be explicit about the files we want to remove. · 95a8707d
      Davide Italiano authored
      Hopefully Windows will stop whining after this change.
      
      llvm-svn: 294801
      95a8707d
    • George Burgess IV's avatar
      Don't let EvaluationModes dictate whether an invalid base is OK · f9013bf8
      George Burgess IV authored
      What we want to actually control this behavior is something more local
      than an EvalutationMode. Please see the linked revision for more
      discussion on why/etc.
      
      This fixes PR31843.
      
      Differential Revision: https://reviews.llvm.org/D29469
      
      llvm-svn: 294800
      f9013bf8
    • Kostya Serebryany's avatar
      s390 CVE-2016-2143 whitelist for RHEL kernels · 4b3ea2d7
      Kostya Serebryany authored
      Summary: This patch adds whitelist for RHEL6 and RHEL7 kernels that are known to have the CVE fixed.
      
      Reviewers: koriakin, kcc
      
      Reviewed By: kcc
      
      Subscribers: kubamracek
      
      Differential Revision: https://reviews.llvm.org/D29825
      
      llvm-svn: 294799
      4b3ea2d7
    • Marshall Clow's avatar
      3bc2e084
    • Richard Smith's avatar
      [c++1z] Diagnose attempts to use variables with deduced class template · bfbff07e
      Richard Smith authored
      specialization types from within their own initializers.
      
      llvm-svn: 294796
      bfbff07e
    • Peter Collingbourne's avatar
      IR: Function summary extensions for whole-program devirtualization pass. · be9ffaac
      Peter Collingbourne authored
      The summary information includes all uses of llvm.type.test and
      llvm.type.checked.load intrinsics that can be used to devirtualize calls,
      including any constant arguments for virtual constant propagation.
      
      Differential Revision: https://reviews.llvm.org/D29734
      
      llvm-svn: 294795
      be9ffaac
    • Benjamin Kramer's avatar
      [InstCombine] Move class into anonymous namespace. NFC. · 03ab8a36
      Benjamin Kramer authored
      This is necessary to avoid warnings from GCC.
      InstCombineLoadStoreAlloca.cpp:238:7: error: 'PointerReplacer' declared
      with greater visibility than the type of its field 'PointerReplacer::IC'
      
      llvm-svn: 294794
      03ab8a36
    • Kostya Serebryany's avatar
      Fix AddressSanitizer on s390 (31-bit) · 5b53a2f2
      Kostya Serebryany authored
      Summary:
      GET_CALLER_PC doesn't work properly on 31-bit s390, as pointers are 31-bit, the MSB bit can be set when the return address is copied into integer.
      This causes e.g. errors like:
          #0 0xfdadb129  (<unknown module>)
          #1 0x7da5e1d1 in __asan::GetStackTraceWithPcBpAndContext(__sanitizer::BufferedStackTrace*, unsigned long, unsigned long, unsigned long, void*, bool) ../../../../../libsanitizer/asan/asan_stack.h:50
          #2 0x7da5e1d1 in __asan::ErrorGeneric::Print() ../../../../../libsanitizer/asan/asan_errors.cc:482
          #3 0x7db178d5 in __asan::ErrorDescription::Print() ../../../../../libsanitizer/asan/asan_errors.h:360
          #4 0x7db178d5 in __asan::ScopedInErrorReport::~ScopedInErrorReport() ../../../../../libsanitizer/asan/asan_report.cc:167
          #5 0x7db178d5 in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ../../../../../libsanitizer/asan/asan_report.cc:397
          #6 0x7dadb14f in __interceptor_memcmp ../../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:626
          #7 0x400cf5 in main /home/jakub/gcc/gcc/testsuite/c-c++-common/asan/memcmp-1.c:14
          #8 0x7d807215 in __libc_start_main (/lib/libc.so.6+0x1a215)
          #9 0x4007ed  (/home/jakub/gcc/obj/gcc/testsuite/memcmp-1.exe+0x4007ed)
      
      The actual return PC inside __interceptor_memcmp was 0x7dadb129 rather than 0xfdadb129.
      
      Reviewers: koriakin, kcc
      
      Reviewed By: kcc
      
      Subscribers: kubamracek
      
      Differential Revision: https://reviews.llvm.org/D29824
      
      llvm-svn: 294793
      5b53a2f2
    • Davide Italiano's avatar
      [lib/LTO] Rework optimization remarkers setup. · 46d72b1b
      Davide Italiano authored
      This makes this code much more similar to what ThinLTO is
      using (also API wise), so now we can probably use a single
      code path instead of copying stuff around.
      
      llvm-svn: 294792
      46d72b1b
    • Benjamin Kramer's avatar
      [PPC] Silence warning in Release builds. · aa5adfa3
      Benjamin Kramer authored
      llvm-svn: 294791
      aa5adfa3
    • Kostya Serebryany's avatar
      s390x __tls_get_addr_internal vs. __tls_get_offset · d94ba361
      Kostya Serebryany authored
      Summary:
      Symbol __tls_get_addr_internal is a GLIBC_PRIVATE private symbol on s390{,x}, the glibc folks aren't very happy about asan using it.
      Additionally, only recent glibc versions have it, older versions just have __tls_get_offset and nothing else.
      The patch doesn't drop the __tls_get_addr_internal interception altogether, but changes it so that it calls real __tls_get_offset function instead (and much more importantly,
      that __tls_get_offset interception calls the real __tls_get_offset function).
      This way it should work also on glibc 2.18 and earlier.  See http://gcc.gnu.org/PR79341 for further details.
      
      Reviewers: kcc, koriakin
      
      Reviewed By: kcc, koriakin
      
      Subscribers: kubamracek, mehdi_amini
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D29735
      
      llvm-svn: 294790
      d94ba361
    • Davide Italiano's avatar
      [LTO] Make these tests robust across multiple iterations. · 62092aeb
      Davide Italiano authored
      Same as r294784, but for regular LTO.
      
      llvm-svn: 294789
      62092aeb
    • Benjamin Kramer's avatar
      [InstCombine] Silence unused variable warning in Release builds. · 684c87be
      Benjamin Kramer authored
      llvm-svn: 294788
      684c87be
    • Nico Weber's avatar
      Revert r294532, it caused PR31935 · ee0b0ec9
      Nico Weber authored
      llvm-svn: 294787
      ee0b0ec9
    • Yaxun Liu's avatar
      Fix invalid addrspacecast due to combining alloca with global var · ba01ed00
      Yaxun Liu authored
      For function-scope variables with large initialisation list, FE usually 
      generates a global variable to hold the initializer, then generates 
      memcpy intrinsic to initialize the alloca. InstCombiner::visitAllocaInst 
      identifies such allocas which are accessed only by reading and replaces 
      them with the global variable. This is done by casting the global variable 
      to the type of the alloca and replacing all references.
      
      However, when the global variable is in a different address space which 
      is disjoint with addr space 0 (e.g. for IR generated from OpenCL, 
      global variable cannot be in private addr space i.e. addr space 0), casting 
      the global variable to addr space 0 results in invalid IR for certain 
      targets (e.g. amdgpu).
      
      To fix this issue, when the global variable is not in addr space 0, 
      instead of casting it to addr space 0, this patch chases down the uses 
      of alloca until reaching the load instructions, then replaces load from 
      alloca with load from the global variable. If during the chasing 
      bitcast and GEP are encountered, new bitcast and GEP based on the global 
      variable are generated and used in the load instructions.
      
      Differential Revision: https://reviews.llvm.org/D27283
      
      llvm-svn: 294786
      ba01ed00
    • Richard Smith's avatar
      [c++1z] Require an initializer for deduced class template specialization types. · d69f4f5b
      Richard Smith authored
      It's actually meaningful and useful to allow such variables to have no
      initializer, but we are strictly following the standard here until the C++
      committee reaches consensus on allowing this.
      
      llvm-svn: 294785
      d69f4f5b
    • Davide Italiano's avatar
      [ThinLTO] Make this test more robust across multiple runs. · d6979b8c
      Davide Italiano authored
      The yaml emitter files are left around otherwise.
      
      llvm-svn: 294784
      d6979b8c
    • Tim Shen's avatar
      Fix a silly syntax error. · 21a960b6
      Tim Shen authored
      llvm-svn: 294783
      21a960b6
    • Dehao Chen's avatar
      Encode duplication factor from loop vectorization and loop unrolling to discriminator. · fb02f714
      Dehao Chen authored
      Summary:
      This patch starts the implementation as discuss in the following RFC: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106532.html
      
      When optimization duplicates code that will scale down the execution count of a basic block, we will record the duplication factor as part of discriminator so that the offline process tool can find the duplication factor and collect the accurate execution frequency of the corresponding source code. Two important optimization that fall into this category is loop vectorization and loop unroll. This patch records the duplication factor for these 2 optimizations.
      
      The recording will be guarded by a flag encode-duplication-in-discriminators, which is off by default.
      
      Reviewers: probinson, aprantl, davidxl, hfinkel, echristo
      
      Reviewed By: hfinkel
      
      Subscribers: mehdi_amini, anemet, mzolotukhin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26420
      
      llvm-svn: 294782
      fb02f714