1. Apr 13, 2016
    • Devin Coughlin's avatar
      [analyzer] Nullability: Suppress return diagnostics in inlined functions. · 49bd58f1
      Devin Coughlin authored
      The nullability checker can sometimes miss detecting nullability precondition
      violations in inlined functions because the binding for the parameter
      that violated the precondition becomes dead before the return:
      
      int * _Nonnull callee(int * _Nonnull p2) {
        if (!p2)
          // p2 becomes dead here, so binding removed.
          return 0; // warning here because value stored in p2 is symbolic.
        else
         return p2;
      }
      
      int *caller(int * _Nonnull p1) {
        return callee(p1);
      }
      
      The fix, which is quite blunt, is to not warn about null returns in inlined
      methods/functions. This won’t lose much coverage for ObjC because the analyzer
      always analyzes each ObjC method at the top level in addition to inlined. It
      *will* lose coverage for C — but there aren’t that many codebases with C
      nullability annotations.
      
      rdar://problem/25615050
      
      llvm-svn: 266109
      49bd58f1
    • Nico Weber's avatar
      clang-cl: Remove -isystem, add -imsvc. · fd3e1ad0
      Nico Weber authored
      r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of
      the system include search path. The idea was to use this to point to a hermetic
      msvc install, but as it turns out this doesn't work: -isystem then adds the
      hermetic headers in front of clang's builtin headers, and clang's headers that
      are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all
      anymore.
      
      So revert that, and instead expose -imsvc which works as if the passed
      directory was part of %INCLUDE%: The header is treated as a system header, but
      it is searched after clang's lib/Header headers.
      
      Fixes half of PRPR26751.
      
      llvm-svn: 266108
      fd3e1ad0
    • Yaxun Liu's avatar
      [OpenCL] Handle AddressSpaceConversion when target address space does not change. · b7b6d0fc
      Yaxun Liu authored
      In codegen different address spaces may be mapped to the same address
      space for a target, e.g. in x86/x86-64 all address spaces are mapped
      to 0. Therefore AddressSpaceConversion should be translated by
      CreatePointerBitCastOrAddrSpaceCast instead of CreateAddrSpaceCast.
      
      Differential Revision: http://reviews.llvm.org/D18713
      
      llvm-svn: 266107
      b7b6d0fc
    • Evgeniy Stepanov's avatar
      [safestack] Fix stack canary test on Mac. · 691ef096
      Evgeniy Stepanov authored
      Disable FORTIFY_SOURCE and explicitly disable stack protector in the
      no-stack-protector run.
      
      llvm-svn: 266106
      691ef096
    • Tom Stellard's avatar
      AMDGPU/SI: Insert wait states required after v_readfirstlane on SI · ab1d3a9d
      Tom Stellard authored
      Summary:
      We will be able to handle this case much better once the hazard recognizer
      is finished, but this conservative implementation  fixes a hang with the piglit
      test:
      
      spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-arra
      
      Reviewers: arsenm, nhaehnle
      
      Subscribers: arsenm, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D18988
      
      llvm-svn: 266105
      ab1d3a9d
    • Matt Arsenault's avatar
      AMDGPU: Eliminate half of i64 or if one operand is zero_extend from i32 · 3b08238f
      Matt Arsenault authored
      This helps clean up some of the mess when expanding unaligned 64-bit
      loads when changed to be promote to v2i32, and fixes situations
      where or x, 0 was emitted after splitting 64-bit ors during moveToVALU.
      
      I think this could be a generic combine but I'm not sure.
      
      llvm-svn: 266104
      3b08238f
    • Enrico Granata's avatar
      Initialize the Python script interpreter lazily (i.e. not at debugger startup) · 15d1b4e2
      Enrico Granata authored
      This time it should also pass the gtests
      
      llvm-svn: 266103
      15d1b4e2
    • Davide Italiano's avatar
      [IR/Verifier] Each DISubprogram with isDefinition: true must belong to a CU. · b390d8ee
      Davide Italiano authored
      Add a check to catch violations. ~60 tests were broken and prevented
      this change to be committed. Adrian and I (thanks Adrian!) went
      through them in the last week or so updating. The check can be
      done more efficiently but I'd still like to get this in ASAP to
      avoid more broken tests to be checked in (if any).
      
      PR:  27101
      llvm-svn: 266102
      b390d8ee
    • Matt Arsenault's avatar
      APInt: Add overload of isMask · c3943574
      Matt Arsenault authored
      This mimics the version in MathExtras.h which isn't testing for a
      specific mask size.
      
      llvm-svn: 266101
      c3943574
    • Ahmed Bougacha's avatar
      [CodeGen] Remove constant-folding dead code. NFC. · 7ac86c47
      Ahmed Bougacha authored
      This code was specific to vector operations with scalar operands:
      all the opcodes in FoldValue (via FoldConstantArithmetic) can't
      match those criteria.
      
      Replace it with an assert if that ever changes: at that point,
      we might need to add back a splat BUILD_VECTOR.
      
      llvm-svn: 266100
      7ac86c47
    • JF Bastien's avatar
      Check alloca's special state · 5502e91c
      JF Bastien authored
      Following up to a similar fix in MergeFunctions: r266022. This patch keeps both in sync, it would be nice to not have to do this. It doesn't look like there's an easy way to test this code directly at the moment: AFAICT all currect uses of isSameOperationAs are looking at instructions deep inside a function. IndVarSimplify/pr24952.ll and InstMerge/st_sink_* look at alloca inadvertently but are brittle tests.
      
      llvm-svn: 266099
      5502e91c
    • Philip Reames's avatar
      Introduce an GCRelocateInst class [NFC] · 92d1f0cb
      Philip Reames authored
      Previously, we were using isGCRelocate predicates.  Using a subclass of IntrinsicInst is far more idiomatic.  The refactoring also enables a couple of minor simplifications and code sharing.
      
      llvm-svn: 266098
      92d1f0cb
    • Sanjay Patel's avatar
      fix indentation; NFC · e6a0a23e
      Sanjay Patel authored
      llvm-svn: 266097
      e6a0a23e
    • Johannes Doerfert's avatar
      fb72187f
    • Evgeniy Stepanov's avatar
      Stricter checks in the stack-protector codegen test. · b0c88776
      Evgeniy Stepanov authored
      llvm-svn: 266095
      b0c88776
    • Jim Ingham's avatar
      Breakpoint conditions were making result variables, which they should not do. · ff7ac6a7
      Jim Ingham authored
      The result variables aren't useful, and if you have a breakpoint on a
      common function you can generate a lot of these.  So I changed the
      code that checks the condition to set ResultVariableIsInternal in the
      EvaluateExpressionOptions that we pass to the execution.
      Unfortunately, the check for this variable was done in the wrong place
      (the static UserExpression::Evaluate) which is not how breakpoint
      conditions execute expressions (UserExpression::Execute).  So I moved
      the check to UserExpression::Execute (which Evaluate also calls) and made the
      overridden method DoExecute.
      
      llvm-svn: 266093
      ff7ac6a7
    • Jim Ingham's avatar
      'int' is reported as an exception on OS X not as a signal. I don't think · 5e2b4890
      Jim Ingham authored
      this test ever succeeded on OS X.
      
      llvm-svn: 266092
      5e2b4890
    • Nico Weber's avatar
      Revert 266090, needs more testing first. · c8b31f30
      Nico Weber authored
      llvm-svn: 266091
      c8b31f30
    • Nico Weber's avatar
      clang-cl: Expose -nostdlibinc. · b790d4fd
      Nico Weber authored
      llvm-svn: 266090
      b790d4fd
    • David Majnemer's avatar
      [FileManager] Don't crash if reading from stdin and stat(".") fails · 1834dc75
      David Majnemer authored
      addAncestorsAsVirtualDirs("<stdin>") quickly returns without doing work
      because "<stdin>" has no parent_path.  This violates the expectation
      that a subsequent call to getDirectoryFromFile("<stdin>") would succeed.
      Instead, it fails because it uses the "." if the file has no path
      component.
      
      Fix this by keeping the behavior between addAncestorsAsVirtualDirs and
      getDirectoryFromFile symmetric.
      
      llvm-svn: 266089
      1834dc75
    • Nicolai Haehnle's avatar
      AMDGPU/SI: Fix a mis-compilation of multi-level breaks · 279970c0
      Nicolai Haehnle authored
      Summary:
      Under certain circumstances, multi-level breaks (or what is understood by
      the control flow passes as such) could be miscompiled in a way that causes
      infinite loops, by emitting incorrect control flow intrinsics.
      
      This fixes a hang in
      dEQP-GLES3.functional.shaders.loops.while_dynamic_iterations.conditional_continue_vertex
      
      Reviewers: arsenm, tstellarAMD
      
      Subscribers: arsenm, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D18967
      
      llvm-svn: 266088
      279970c0
    • Johannes Doerfert's avatar
      Do not by default minimize remarks · 2f70584a
      Johannes Doerfert authored
        We used checks to minimize the number of remarks we present to a user
        but these checks can become expensive, especially since all wrapping
        assumptions are emitted separately. Because there is not benefit for a
        "headless" run we put these checks under a command line flag. Thus, if
        the flag is not given we will emit "non-effective" remarks, e.g.,
        duplicates and revert to the old behaviour if it is given. As this
        also changes the internal representation of some sets we set the flag
        by default for our unit tests.
      
      llvm-svn: 266087
      2f70584a
  2. Apr 12, 2016