1. Aug 22, 2015
    • Ahmed Bougacha's avatar
      [ARM NEON] Remove special-case for f16 vcvt handling. NFCI. · 86da3d8d
      Ahmed Bougacha authored
      We can use the 'H' typespec modifier to use 128-bit vectors directly
      in the only two users of this special-case: the vcvt f16 intrinsics.
      This also lets us use more meaningful prototype modifiers.
      
      llvm-svn: 245778
      86da3d8d
    • Alexey Samsonov's avatar
      Try to fix Mac build. · 74683fe5
      Alexey Samsonov authored
      llvm-svn: 245777
      74683fe5
    • Alexey Samsonov's avatar
      [TSan] Support __sanitizer_set_death_callback(). · eb4fe788
      Alexey Samsonov authored
      llvm-svn: 245776
      eb4fe788
    • Matt Arsenault's avatar
      AMDGPU: Allow specifying different opcode on VI for SMRD/SMEM · 0a3ac1be
      Matt Arsenault authored
      Although the basic s_load_* instructions happen to use the same
      opcode, some of the special case SMRD instructions have
      different opcodes.
      
      llvm-svn: 245775
      0a3ac1be
    • Matt Arsenault's avatar
      e8df8799
    • Evgeniy Stepanov's avatar
      [asan] Don't apply glibc-specific TLS calculations on Android. · d6376d98
      Evgeniy Stepanov authored
      This fixes an infinite recursion between GetTls and GetTlsSize on
      Android-x86.
      
      llvm-svn: 245773
      d6376d98
    • Matt Arsenault's avatar
      AMDGPU: Use DFS to avoid second loop over function · 33010103
      Matt Arsenault authored
      llvm-svn: 245772
      33010103
    • John McCall's avatar
      When building a pseudo-object assignment, and the RHS is · ee04aebb
      John McCall authored
      a contextually-typed expression that semantic analysis will
      probably need to invasively rewrite, don't include the
      RHS OVE as a separate semantic expression, and check the
      operation with the original RHS expression.
      
      There are two contextually-typed expressions that can survive
      to here: overloaded function references, which are at least
      safe to double-emit, and C++11 initializer list expressions,
      which are not at all safe to double-emit and which often
      don't update the original syntactic InitListExpr with
      implicit conversions to member types, etc.
      
      This means that the original RHS may appear, undecorated by
      an OVE, in the semantic expressions.  Fortunately, it will
      only ever be used in a single place there, and I don't
      believe there are clients that rely on being able to pick
      out the original RHS from the semantic expressions.
      But this could be problematic if there are clients that do
      visit the entire tree and rely on not seeing the same
      expression multiple times, once in the syntactic and once
      in the semantic expressions.  This is a very fiddly part
      of the compiler.
      
      rdar://21801088
      
      llvm-svn: 245771
      ee04aebb
    • Alexey Samsonov's avatar
      [Sanitizer] Dump coverage if we're killing the program with __sanitizer::Die(). · 8e38c71c
      Alexey Samsonov authored
      Previously we had to call __sanitizer_cov_dump() from tool-specific
      callbacks - instead, let sanitizer_common library handle this in a single place.
      
      llvm-svn: 245770
      8e38c71c
    • Matt Arsenault's avatar
      AMDGPU: Make sure to run verifier after SIFixSGPRLiveRanges · c8d8e4ed
      Matt Arsenault authored
      llvm-svn: 245769
      c8d8e4ed
    • Matt Arsenault's avatar
      AMDGPU: Improve debug printing in SIFixSGPRLiveRanges · aba29d6a
      Matt Arsenault authored
      llvm-svn: 245768
      aba29d6a
    • Matt Arsenault's avatar
      AMDGPU: Move CI instructions into CIInstructions.td · 6adf07a9
      Matt Arsenault authored
      There are still a couple of CI patterns left in SIInstructions.
      
      llvm-svn: 245767
      6adf07a9
    • Alexey Samsonov's avatar
      [DFSan] Remove nolibc build. · b6a604ae
      Alexey Samsonov authored
      It's not used now, as is not even included in "dfsan" target.
      
      llvm-svn: 245766
      b6a604ae
    • Zachary Turner's avatar
      Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD." · 21708cf9
      Zachary Turner authored
      This reverts commit 7749a10ddbe22767d0e055753c674fcde7f28d39.
      
      This commit introduces about 15-20 new test failures with windows local
      targets.
      
      llvm-svn: 245765
      21708cf9
    • Matt Arsenault's avatar
      AMDGPU: Minor cleanups to help with f16 support · f56872dc
      Matt Arsenault authored
      The main change is inverting the condition for the
      operand class classes so that VT.Size == 16 uses VGPR_32
      instead of 64.
      
      llvm-svn: 245764
      f56872dc
    • Ahmed Bougacha's avatar
      [ARM NEON] Use the common naming scheme for vcvt f16 builtins. NFC. · cd5b8a02
      Ahmed Bougacha authored
      We had "vcvt_f16" and "VCVT_HIGH_F16": for other FP types, this naming
      is used for intrinsics with integer overloads. The FP->FP conversions,
      on the other hand, use the full "vcvt_f32_f64" name instead.
      
      Use the same naming convention for the f16<->f32 conversions.
      While there, reorder the definitions a little bit.
      
      llvm-svn: 245763
      cd5b8a02
    • JF Bastien's avatar
      Improve the determinism of MergeFunctions · 057292a7
      JF Bastien authored
      Summary:
      
      Merge functions previously relied on unsigned comparisons of pointer values to
      order functions. This caused observable non-determinism in the compiler for
      large bitcode programs. Basically, opt -mergefuncs program.bc | md5sum produces
      different hashes when run repeatedly on the same machine. Differing output was
      observed on three large bitcodes, but it was less frequent on the smallest file.
      It is possible that this only manifests on the large inputs, hence remaining
      undetected until now.
      
      This patch fixes this by removing (almost, see below) all places where
      comparisons between pointers are used to order functions. Most of these changes
      are local, but the comparison of global values requires assigning an identifier
      to each local in the order it is visited. This is very similar to the way the
      comparison function identifies Value*'s defined within a function. Because the
      order of visiting the functions and their subparts is deterministic, the
      identifiers assigned to the globals will be as well, and the order of functions
      will be deterministic.
      
      With these changes, there is no more observed non-determinism. There is also
      only minor slowdowns (negligible to 4%) compared to the baseline, which is
      likely a result of the fact that global comparisons involve hash lookups and not
      just pointer comparisons.
      
      The one caveat so far is that programs containing BlockAddress constants can
      still be non-deterministic. It is not clear what the right solution is here. In
      particular, even if the global numbers are used to order by function, we still
      need a way to order the BasicBlock*'s. Unfortunately, we cannot just bail out
      and fail to order the functions or consider them equal, because we require a
      total order over functions. Note that programs with BlockAddress constants are
      relatively rare, so the impact of leaving this in is minor as long as this pass
      is opt-in.
      
      Author: jrkoenig
      
      Reviewers: nlewycky, jfb, dschuff
      
      Subscribers: jevinskie, llvm-commits, chapuni
      
      Differential revision: http://reviews.llvm.org/D12168
      
      llvm-svn: 245762
      057292a7
    • Ahmed Bougacha's avatar
      [ARM NEON] Factor out FP-prototype checking. NFC. · 22a16965
      Ahmed Bougacha authored
      llvm-svn: 245761
      22a16965
    • Adam Nemet's avatar
      [LAA] Hold bounds via ValueHandles during SCEV expansion · 4e533ef7
      Adam Nemet authored
      SCEV expansion can invalidate previously expanded values.  For example
      in SCEVExpander::ReuseOrCreateCast, if we already have the requested
      cast value but it's not at the desired location, a new cast is inserted
      and the old cast will be invalidated.
      
      Therefore, when expanding the bounds for the pointers, a later entry can
      invalidate the IR value for an earlier one.  The fix is to store a value
      handle rather than the value itself.
      
      The newly added test has a more detailed description of how the bug
      triggers.
      
      This bug can have a negative but potentially highly variable performance
      impact in Loop Distribution.  Because one of the bound values was
      invalidated and is an undef expression now, InstCombine is free to
      transform the array overlap check:
      
         Start0 <= End1 && Start1 <= End0
      
      into:
      
         Start0 <= End1
      
      So depending on the runtime location of the arrays, we would detect a
      conflict and fall back on the original loop of the versioned loop.
      
      Also tested compile time with SPEC2006 LTO bc files.
      
      llvm-svn: 245760
      4e533ef7
    • Tyler Nowicki's avatar
      Standardized 'failed' to 'Failed' in LoopVectorizationRequirements. · 552a62fa
      Tyler Nowicki authored
      llvm-svn: 245759
      552a62fa
    • Alexey Samsonov's avatar
      [LSan] Support __sanitizer_set_death_callback in standalone LSan. · fc95c85c
      Alexey Samsonov authored
      llvm-svn: 245758
      fc95c85c
    • Alex Lorenz's avatar
      MIRLangRef: Add 'MIR Testing Guide' section. · ea788c4b
      Alex Lorenz authored
      llvm-svn: 245757
      ea788c4b
    • Peter Collingbourne's avatar
      LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model. · 44ee84ee
      Peter Collingbourne authored
      This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto
      and has the side effect of improving error handling in the libLTO C API.
      
      llvm-svn: 245756
      44ee84ee
    • Tom Stellard's avatar
      AMDGPU/SI: Better handle s_wait insertion · bd8a0856
      Tom Stellard authored
      We can wait on either VM, EXP or LGKM.
      The waits are independent.
      
      Without this patch, a wait inserted because of one of them
      would also wait for all the previous others.
      This patch makes s_wait only wait for the ones we need for the next
      instruction.
      
      Here's an example of subtle perf reduction this patch solves:
      
      This is without the patch:
      
      buffer_load_format_xyzw v[8:11], v0, s[44:47], 0 idxen
      buffer_load_format_xyzw v[12:15], v0, s[48:51], 0 idxen
      s_load_dwordx4 s[44:47], s[8:9], 0xc
      s_waitcnt lgkmcnt(0)
      buffer_load_format_xyzw v[16:19], v0, s[52:55], 0 idxen
      s_load_dwordx4 s[48:51], s[8:9], 0x10
      s_waitcnt vmcnt(1)
      buffer_load_format_xyzw v[20:23], v0, s[44:47], 0 idxen
      
      The s_waitcnt vmcnt(1) is useless.
      The reason it is added is because the last
      buffer_load_format_xyzw needs s[44:47], which was issued
      by the first s_load_dwordx4. It waits for all VM
      before that call to have finished.
      
      Internally after every instruction, 3 counters (for VM, EXP and LGTM)
      are updated after every instruction. For example buffer_load_format_xyzw
      will
      increase the VM counter, and s_load_dwordx4 the LGKM one.
      
      Without the patch, for every defined register,
      the current 3 counters are stored, and are used to know
      how long to wait when an instruction needs the register.
      
      Because of that, the s[44:47] counter includes that to use the register
      you need to wait for the previous buffer_load_format_xyzw.
      
      Instead this patch stores only the counters that matter for the
      register,
      and puts zero for the other ones, since we don't need any wait for them.
      
      Patch by: Axel Davy
      
      Differential Revision: http://reviews.llvm.org/D11883
      
      llvm-svn: 245755
      bd8a0856
    • Alexey Samsonov's avatar
    • Sanjoy Das's avatar
      Re-apply r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0" · c86c162a
      Sanjoy Das authored
      The original checkin was buggy, this change has a fix.
      
      Original commit message:
      
      [InstCombine] Transform A & (L - 1) u< L --> L != 0
      
      Summary:
      
      This transform is never a pessimization at the IR level (since it
      replaces an `icmp` with another), and has potentiall payoffs:
      
       1. It may make the `icmp` fold away or become loop invariant.
       2. It may make the `A & (L - 1)` computation dead.
      
      This shows up in Java, in range checks generated by array accesses of
      the form `a[i & (a.length - 1)]`.
      
      Reviewers: reames, majnemer
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D12210
      
      llvm-svn: 245753
      c86c162a
    • David Blaikie's avatar
      Range-for-ify some things in GlobalMerge · 47bf5c01
      David Blaikie authored
      llvm-svn: 245752
      47bf5c01
    • Zachary Turner's avatar
      XFAIL pthreads test on Windows. · 2156787b
      Zachary Turner authored
      This test needs to be ported to c++ threads.
      
      llvm-svn: 245751
      2156787b
    • Zachary Turner's avatar
      Fix TestPaths on Windows. · b20bafae
      Zachary Turner authored
      llvm-svn: 245750
      b20bafae
    • Zachary Turner's avatar
      XFAIL the last Windows test that calls a function in the target. · 7c9e1c0b
      Zachary Turner authored
      llvm-svn: 245749
      7c9e1c0b
    • Zachary Turner's avatar
      Skip TestCreateAfterAttach on Windows. · 6df0cbc0
      Zachary Turner authored
      As with every other platform, this test occasionally hangs on
      Windows.
      
      llvm-svn: 245748
      6df0cbc0
    • Zachary Turner's avatar
      XFAIL Tests that require C++ exceptions on Windows. · 28ee0cd3
      Zachary Turner authored
      clang-cl does not yet support C++ exceptions, so these tests will
      not even compile.
      
      Re-enabling these tests is tracked by llvm.org/pr24538
      
      llvm-svn: 245747
      28ee0cd3
    • David Blaikie's avatar
      [opaque pointer types] Fix a few easy places in GlobalMerge that were... · 9ed57a9e
      David Blaikie authored
      [opaque pointer types] Fix a few easy places in GlobalMerge that were accessing value types through pointee types
      
      llvm-svn: 245746
      9ed57a9e
    • Alex Lorenz's avatar
      MIR Serialization: Serialize the pointer IR expression values in the machine · c1136ef3
      Alex Lorenz authored
      memory operands.
      
      llvm-svn: 245745
      c1136ef3
    • Vedant Kumar's avatar
      [ARM] Fix MachO CPU Subtype selection · 366dd9fd
      Vedant Kumar authored
      Differential Revision: http://reviews.llvm.org/D12040
      
      llvm-svn: 245744
      366dd9fd
    • Alex Lorenz's avatar
      MIRParser: Split the 'parseIRConstant' method into two methods. NFC. · 5d8b0bd9
      Alex Lorenz authored
      One variant of this method can be reused when parsing the quoted IR pointer
      expressions in the machine memory operands.
      
      llvm-svn: 245743
      5d8b0bd9
    • David Blaikie's avatar
      [opaque pointer types] Push the passing of value types up from... · d583b195
      David Blaikie authored
      [opaque pointer types] Push the passing of value types up from Function/GlobalVariable to GlobalObject
      
      (coming next, pushing this up into GlobalValue, so it can store the
      value type directly)
      
      llvm-svn: 245742
      d583b195
    • Hal Finkel's avatar
      [PowerPC] PPCVSXFMAMutate should not segfault on undef input registers · ff9639d6
      Hal Finkel authored
      When PPCVSXFMAMutate would look at the input addend register, it would get its
      input value number. This would fail, however, if the register was undef,
      causing a segfault. Don't segfault (just skip such FMA instructions).
      
      Fixes the test case from PR24542 (although that may have been over-reduced).
      
      llvm-svn: 245741
      ff9639d6
    • Alex Lorenz's avatar
      AsmParser: Save and restore the parsing state for types using SlotMapping. · 1de2acd3
      Alex Lorenz authored
      This commit extends the 'SlotMapping' structure and includes mappings for named
      and numbered types in it. The LLParser is extended accordingly to fill out
      those mappings at the end of module parsing.
      
      This information is useful when we want to parse standalone constant values
      at a later stage using the 'parseConstantValue' method. The constant values
      can be constant expressions, which can contain references to types. In order
      to parse such constant values, we have to restore the internal named and
      numbered mappings for the types in LLParser, otherwise the parser will report
      a parsing error. Therefore, this commit also introduces a new method called
      'restoreParsingState' to LLParser, which uses the slot mappings to restore
      some of its internal parsing state.
      
      This commit is required to serialize constant value pointers in the machine
      memory operands for the MIR format.
      
      Reviewers: Duncan P. N. Exon Smith
      llvm-svn: 245740
      1de2acd3
    • Bruno Cardoso Lopes's avatar
      [LVI] Use a SmallVector instead of SmallPtrSet. NFC · 7a1483e7
      Bruno Cardoso Lopes authored
      llvm-svn: 245739
      7a1483e7