1. Oct 15, 2014
    • Ed Maste's avatar
      Fix compiler-rt build on FreeBSD 10.1 · 3ba162d2
      Ed Maste authored
      We have to #define _WANT_RTENTRY to get struct rtentry, and add headers
      that it depends on.
      
      SIOCADDRT and SIOCDELRT also do not exist in FreeBSD 10.1 and were removed
      in FreeBSD rev. 263203:
      
        Garbage collect long time obsoleted (or never used) stuff from routing
        API.
      
      Differential Revision: http://reviews.llvm.org/D5703
      
      llvm-svn: 219722
      3ba162d2
    • Renato Golin's avatar
      Re-enable ASAN/UBSAN tests on ARM, with VFP3 they began to pass · 498b223e
      Renato Golin authored
      When compiling with -mfpu=vfpv3, those tests began to pass, like the others
      with "Illegal Instruction" error, so removing the XFAIL from them should
      get the bot green (and have more tests!).
      
      llvm-svn: 219721
      498b223e
    • Tim Northover's avatar
      ARM: set preferred aggregate alignment to 32 universally. · b98dc4b0
      Tim Northover authored
      Before, ARM and Thumb mode code had different preferred alignments, which could
      lead to some rather unexpected results. There's justification for reducing it
      from the default 64-bits (wasted space), but I don't think there is for going
      below 32-bits.
      
      There's no actual ABI change here, just to reassure people.
      
      llvm-svn: 219720
      b98dc4b0
    • Tim Northover's avatar
      ARM: set preferred aggregate alignment to 32 universally. · aa09ac6e
      Tim Northover authored
      Before, ARM and Thumb mode code had different preferred alignments, which could
      lead to some rather unexpected results. There's justification for reducing it
      from the default 64-bits (wasted space), but I don't think there is for going
      below 32-bits.
      
      There's no actual ABI change here, just to reassure people.
      
      llvm-svn: 219719
      aa09ac6e
    • Hal Finkel's avatar
      [CFL-AA] CFL-AA should not assert on an va_arg instruction · db5f86a9
      Hal Finkel authored
      The CFL-AA implementation was missing a visit* routine for va_arg instructions,
      causing it to assert when run on a function that had one. For now, handle these
      in a conservative way.
      
      Fixes PR20954.
      
      llvm-svn: 219718
      db5f86a9
    • Sanjay Patel's avatar
      Optimize away fabs() calls when input is squared (known positive). · 0ca42bb5
      Sanjay Patel authored
      Eliminate library calls and intrinsic calls to fabs when the input 
      is a squared value.
      
      Note that no unsafe-math / fast-math assumptions are needed for
      this optimization.
      
      Differential Revision: http://reviews.llvm.org/D5777
      
      llvm-svn: 219717
      0ca42bb5
    • Juergen Ributzka's avatar
      [FastISel][AArch64] Fix sign-/zero-extend folding when SelectionDAG is involved. · cd11a280
      Juergen Ributzka authored
      Sign-/zero-extend folding depended on the load and the integer extend to be
      both selected by FastISel. This cannot always be garantueed and SelectionDAG
      might interfer. This commit adds additonal checks to load and integer extend
      lowering to catch this.
      
      Related to rdar://problem/18495928.
      
      llvm-svn: 219716
      cd11a280
    • Bob Wilson's avatar
      Add complex multiply/divide functions to arm64 iOS libclang_rt libraries. · ca0a38e0
      Bob Wilson authored
      Clang r219557 introduces libcalls to complex multiply/divide functions.
      Since these functions are not available in iOS for arm64 devices, add them to
      the static libraries.
      
      llvm-svn: 219715
      ca0a38e0
    • Reid Kleckner's avatar
      Factor code into CXXRecordDecl::getTemplateInstantiationPattern() helper · e7367d6b
      Reid Kleckner authored
      This moves some code from SemaType.cpp's hasVisibleDefinition() into
      DeclCXX.cpp so that it can be used elsewhere. I found one other instance
      of code trying to do the same thing, there are probably more. Search for
      getInstantiatedFrom() to try to find more.
      
      No functionality change.
      
      Reviewed By: rsmith
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D5783
      
      llvm-svn: 219714
      e7367d6b
    • David Majnemer's avatar
      InstCombine: Don't miscompile X % ((Pow2 << A) >>u B) · dad21038
      David Majnemer authored
      We assumed that A must be greater than B because the right hand side of
      a remainder operator must be nonzero.
      
      However, it is possible for A to be less than B if Pow2 is a power of
      two greater than 1.
      
      Take for example:
      i32 %A = 0
      i32 %B = 31
      i32 Pow2 = 2147483648
      
      ((Pow2 << 0) >>u 31) is non-zero but A is less than B.
      
      This fixes PR21274.
      
      llvm-svn: 219713
      dad21038
    • Fariborz Jahanian's avatar
      Patch to warn on interger overflow in presence of · c694e693
      Fariborz Jahanian authored
      implicit casts. Reviewed by Reid Kleckner.
      rdar://18405357
      
      llvm-svn: 219712
      c694e693
    • Greg Clayton's avatar
      Fixed stdio redirection within LLDB to "do the right thing" in all cases. · b8e9b8b7
      Greg Clayton authored
      The main issue was if you didn't specify all three (stdin/out/err), you would get file actions added to the launch that would always use the pseudo terminal. This is now fixed.
      
      Also fixed the test suite test that handles IO to test redirecting things individually and all together and in other combinations to make sure we don't regress.
      
      <rdar://problem/18638226>
      
      llvm-svn: 219711
      b8e9b8b7
    • Jan Vesely's avatar
      Reapply "R600: Add new intrinsic to read work dimensions" · e5121f3c
      Jan Vesely authored
      
      
      This effectively reverts revert 219707. After fixing the test to work with
      new function name format and renamed intrinsic.
      
      Reviewed-by: default avatarTom Stellard <tom@stellard.net>
      Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
      llvm-svn: 219710
      e5121f3c
    • Rui Ueyama's avatar
      Use llvm::make_unique. · 4121d5a2
      Rui Ueyama authored
      llvm-svn: 219709
      4121d5a2
    • Hal Finkel's avatar
      Revert "r216914 - Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'" · 171c2ec0
      Hal Finkel authored
      Reapply r216913, a fix for PR20832 by Andrea Di Biagio. The commit was reverted
      because of buildbot failures, and credit goes to Ulrich Weigand for isolating
      the underlying issue (which can be confirmed by Valgrind, which does helpfully
      light up like the fourth of July). Uli explained the problem with the original
      patch as:
      
        It seems the problem is calling multiplySignificand with an addend of category
        fcZero; that is not expected by this routine.  Note that for fcZero, the
        significand parts are simply uninitialized, but the code in (or rather, called
        from) multiplySignificand will unconditionally access them -- in effect using
        uninitialized contents.
      
      This version avoids using a category == fcZero addend within
      multiplySignificand, which avoids this problem (the Valgrind output is also now
      clean).
      
      Original commit message:
      
      [APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
      
      When folding a fused multiply-add builtin call, make sure that we propagate the
      correct result in the case where the addend is zero, and the two other operands
      are finite non-zero.
      
      Example:
        define double @test() {
          %1 = call double @llvm.fma.f64(double 7.0, double 8.0, double 0.0)
          ret double %1
        }
      
      Before this patch, the instruction simplifier wrongly folded the builtin call
      in function @test to constant 'double 7.0'.
      With this patch, method 'fusedMultiplyAdd' correctly evaluates the multiply and
      propagates the expected result (i.e. 56.0).
      
      Added test fold-builtin-fma.ll with the reproducible from PR20832 plus extra
      test cases to verify the behavior of method 'fusedMultiplyAdd' in the presence
      of NaN/Inf operands.
      
      This fixes PR20832.
      
      llvm-svn: 219708
      171c2ec0
    • Rafael Espindola's avatar
      Revert "R600: Add new intrinsic to read work dimensions" · db3f0a24
      Rafael Espindola authored
      This reverts commit r219705.
      
      CodeGen/R600/work-item-intrinsics.ll was failing on linux.
      
      llvm-svn: 219707
      db3f0a24
    • Rafael Espindola's avatar
      Remove unused member variable. · 76936ebc
      Rafael Espindola authored
      Fixes pr20904.
      
      llvm-svn: 219706
      76936ebc
    • Jan Vesely's avatar
      R600: Add new intrinsic to read work dimensions · 86187d23
      Jan Vesely authored
      
      
      v2: Add SI lowering
          Add test
      
      v3: Place work dimensions after the kernel arguments.
      v4: Calculate offset while lowering arguments
      v5: rebase
      v6: change prefix to AMDGPU
      
      Reviewed-by: default avatarTom Stellard <tom@stellard.net>
      Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
      llvm-svn: 219705
      86187d23
    • Jan Vesely's avatar
      R600: FMA is VecALU only instruction · df196963
      Jan Vesely authored
      
      
      Reviewed-by: default avatarTom Stellard <tom@stellard.net>
      Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
      llvm-svn: 219704
      df196963
    • Reed Kotler's avatar
      Finish getting Mips fast-isel to match up with AArch64 fast-isel · d4ea29e6
      Reed Kotler authored
      Summary:
      In order to facilitate use of common code, checking by reviewers of other fast-isel ports, and hopefully to eventually move most of Mips and other fast-isel ports into target independent code, I've tried to get the two implementations to line up.
      
      There is no functional code change. Just methods moved in the file to be in the same order as in AArch64.
      
      Test Plan: No functional change.
      
      Reviewers: dsanders
      
      Reviewed By: dsanders
      
      Subscribers: llvm-commits, aemerson, rfuhler
      
      Differential Revision: http://reviews.llvm.org/D5692
      
      llvm-svn: 219703
      d4ea29e6
    • David Blaikie's avatar
      DebugInfo: Ensure that all debug location scope chains from instructions... · 3dfe4788
      David Blaikie authored
      DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.
      
      Let me tell you a tale...
      
      Originally committed in r211723 after discovering a nasty case of weird
      scoping due to inlining, this was reverted in r211724 after it fired in
      ASan/compiler-rt.
      
      (minor diversion where I accidentally committed/reverted again in
      r211871/r211873)
      
      After further testing and fixing bugs in ArgumentPromotion (r211872) and
      Inlining (r212065) it was recommitted in r212085. Reverted in r212089
      after the sanitizer buildbots still showed problems.
      
      Fixed another bug in ArgumentPromotion (r212128) found by this
      assertion.
      
      Recommitted in r212205, reverted in r212226 after it crashed some more
      on sanitizer buildbots.
      
      Fix clang some more in r212761.
      
      Recommitted in r212776, reverted in r212793. ASan failures.
      Recommitted in r213391, reverted in r213432, trying to reproduce flakey
      ASan build failure.
      
      Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952
      (LiveDebugVariables strips dbg_value intrinsics in functions not
      described by debug info).
      
      Recommitted in r214761, reverted in r214999, flakey failure on Windows
      buildbot.
      
      Fixed DeadArgElimination + DebugInfo bug in r219210.
      
      Recommitted in r219215, reverted in r219512, failure on ObjC++ atomic
      properties in the test-suite on Darwin.
      
      Fixed ObjC++ atomic properties issue in Clang in r219690.
      
      [This commit is provided 'as is' with no hope that this is the last time
      I commit this change either expressed or implied]
      
      llvm-svn: 219702
      3dfe4788
    • Ed Maste's avatar
      Skip asan test on FreeBSD · c08a5632
      Ed Maste authored
      The build fails due to missing asan runtime in the FreeBSD base system.
      Instead of marking it expected fail, just skip until we have the runtime
      available.
      
      llvm.org/pr21136
      
      llvm-svn: 219701
      c08a5632
    • Rafael Espindola's avatar
      Remove method that is identical to the base class one. · c5747791
      Rafael Espindola authored
      llvm-svn: 219700
      c5747791
    • Alexey Samsonov's avatar
      [UBSan] XFAIL test added in r219642 on Darwin · 37efdf00
      Alexey Samsonov authored
      llvm-svn: 219699
      37efdf00
    • Matt Arsenault's avatar
      R600/SI: Use DS offsets for constant addresses · e775f5fe
      Matt Arsenault authored
      Use 0 as the base address for a constant address, so if
      we have a constant address we can save moves and form
      read2/write2s.
      
      llvm-svn: 219698
      e775f5fe
    • Saleem Abdulrasool's avatar
      CodeGen: correct block mangling in ObjC · 3b434476
      Saleem Abdulrasool authored
      Mangling for blocks defined within blocks in an ObjectiveC context were also
      broken by SVN r219393.  Because the code in mangleName assumed that the code was
      either C or C++, we would trigger assertions when trying to mangle the inner
      blocks in an ObjectiveC context.
      
      Add a test and use the ObjectiveC specific mangling when dealing with an
      ObjectiveC method declaration.
      
      llvm-svn: 219697
      3b434476
    • Saleem Abdulrasool's avatar
      CodeGen: correct mangling for blocks · 64ab4de4
      Saleem Abdulrasool authored
      This addresses a regression introduced with SVN r219393.  A block may be
      contained within another block.  In such a scenario, we would end up within a
      BlockDecl, which is not a NamedDecl (as the names are synthesised).  The cast to
      a NamedDecl of the DeclContext would then assert as the types are unrelated.
      
      Restore the mangling behaviour to that prior to SVN r219393.  If the current
      block is contained within a BlockDecl, walk up to the parent DeclContext,
      recursively, until we have a non-BlockDecl.  This is expected to be a NamedDecl.
      Add in a couple of asserts to ensure that the assumption that we only encounter
      a block within a NamedDecl or a BlockDecl.
      
      llvm-svn: 219696
      64ab4de4
    • David Blaikie's avatar
      Revert "Fix stuff... again." · 24026502
      David Blaikie authored
      Accidental commit.
      
      This reverts commit r219693.
      
      llvm-svn: 219695
      24026502
    • David Blaikie's avatar
      Revert some parts of r196288 that were confusing and untested. · e75f963c
      David Blaikie authored
      If we figure out why they should be here, let's add some testing of some
      kind so we can better demonstrate why it's needed.
      
      llvm-svn: 219694
      e75f963c
    • David Blaikie's avatar
      Fix stuff... again. · 27549023
      David Blaikie authored
      llvm-svn: 219693
      27549023
    • David Blaikie's avatar
      Formatting for prior commit · 8e90d221
      David Blaikie authored
      llvm-svn: 219692
      8e90d221
    • Ulrich Weigand's avatar
      [SystemZ] Address review comments for r219679 · 804a3e65
      Ulrich Weigand authored
      llvm-svn: 219691
      804a3e65
    • David Blaikie's avatar
      DebugInfo: Don't leak location information from one function into the prologue... · 8e6c36eb
      David Blaikie authored
      DebugInfo: Don't leak location information from one function into the prologue of the next function.
      
      CodeGenFunction objects aren't really designed to be reused for more
      than one function, and doing so can leak debug info location information
      from one function into the prologue of the next.
      
      Add an assertion in to catch reuses of CodeGenFunction, which
      surprisingly only caught the ObjC atomic getter/setter cases. Fix those
      and add a test to demonstrate the issue.
      
      The test is a bit slim, because we're just testing for the absence of a
      debug location on the prologue instructions, which by itself probably
      wouldn't be the end of the world - but the particular debug location
      that was ending up there was for the previous function's last
      instruction. This produced debug info for another function within this
      function, which is something I'm trying to remove all cases of as its a
      substantial source of bugs, especially around inlining (see r219215).
      
      llvm-svn: 219690
      8e6c36eb
    • Todd Fiala's avatar
      Fix dotest.py test runner exit code to return non-zero on failure/error. · d7e27eac
      Todd Fiala authored
      This addresses this bug:
      http://www.llvm.org/bugs/show_bug.cgi?id=21267
      
      Which has been broken since svn r215256 on Aug 8 2014.
      
      DO NOT REVERT THIS COMMIT EVEN IF IT CREATES TEST FAILURES.
      
      The test failures are a result of accumulation of hidden failures
      that were masked by the bug this change fixes.  Most of our test
      runners as part of build testing rely on dotest.py returning non-zero to indicate
      some kind of errant test run.  Thus, we have been flying blind
      since Aug 8 2014.
      
      llvm-svn: 219689
      d7e27eac
    • Hal Finkel's avatar
      [LVI] Check for @llvm.assume dominating the edge branch · a3f23e37
      Hal Finkel authored
      When LazyValueInfo uses @llvm.assume intrinsics to provide edge-value
      constraints, we should check for intrinsics that dominate the edge's branch,
      not just any potential context instructions. An assumption that dominates the
      edge's branch represents a truth on that edge. This is specifically useful, for
      example, if multiple predecessors assume a pointer to be nonnull, allowing us
      to simplify a later null comparison.
      
      The test case, and an initial patch, were provided by Philip Reames. Thanks!
      
      llvm-svn: 219688
      a3f23e37
  2. Oct 14, 2014