Skip to content
  1. Jul 19, 2016
    • Sanjay Patel's avatar
      add even more missing tests for simplifySelectBitTest() · 47c04f95
      Sanjay Patel authored
      llvm-svn: 276024
      47c04f95
    • George Burgess IV's avatar
      [CFLAA] Teach CFLAnders to distinguish reads from writes. · c01b42fa
      George Burgess IV authored
      This patch adds more specific edges to CFLAndersAliasAnalysis. The goal
      of these edges is to give us more information about *how* two values
      that MayAlias alias. With this, we can now tell cases like
      
      a = b; // ergo, a may alias b
      
      apart from
      
      a = c;
      b = c;
      
      // so, a may alias b, but only because they were both assigned to c.
      
      ...And others.
      
      Patch by Jia Chen.
      
      Differential Revision: https://reviews.llvm.org/D22429
      
      llvm-svn: 276023
      c01b42fa
    • Richard Smith's avatar
      Attempt to bring peace to -Werror buildbots. · 398d9c0c
      Richard Smith authored
      llvm-svn: 276022
      398d9c0c
    • Xinliang David Li's avatar
      [Profile] move utility interfaces to the right header /NFC · d4c5e27a
      Xinliang David Li authored
      llvm-svn: 276021
      d4c5e27a
    • Bruno Cardoso Lopes's avatar
      [SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics · 1383ddc4
      Bruno Cardoso Lopes authored
      Sema actions on ObjCDictionaryLiteral and ObjCArryLiteral are currently
      done as a side-effect of Sema upon parent expressions, which incurs of
      delayed typo corrections for such literals to be performed by TypoTransforms
      upon the ObjCDictionaryLiteral and ObjCArryLiteral themselves instead of
      its elements individually.
      
      This is specially bad because it was not designed to act on several
      elements; searching through all possible combinations of corrections for
      several elements is very expensive. Additionally, when one of the
      elements has no correction candidate, we still explore all options and
      at the end emit no typo corrections whatsoever.
      
      Do the proper sema actions by acting on each element alone during appropriate
      literal parsing time to get proper diagonistics and decent compile time
      behavior.
      
      Differential Revision: http://reviews.llvm.org/D22183
      
      rdar://problem/21046678
      
      llvm-svn: 276020
      1383ddc4
    • Xinliang David Li's avatar
      [Profile] use portable macro /NFC · d9689aff
      Xinliang David Li authored
      llvm-svn: 276019
      d9689aff
    • Aaron Ballman's avatar
      This code block breaks the docs build... · a0c1f408
      Aaron Ballman authored
      This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11921/steps/docs-llvm-html/logs/stdio). Setting the code highlighting to none instead of llvm to hopefully get the bot stumbling back towards green.
      
      llvm-svn: 276018
      a0c1f408
    • Rafael Espindola's avatar
      Use posix_fallocate instead of ftruncate. · 3816c53f
      Rafael Espindola authored
      This makes sure that space is actually available. With this change
      running lld on a full file system causes it to exit with
      
      failed to open foo: No space left on device
      
      instead of crashing with a sigbus.
      
      llvm-svn: 276017
      3816c53f
    • Richard Smith's avatar
      [libcxxabi] When catching an exception of type nullptr_t with a handler of · 2f984cab
      Richard Smith authored
      pointer-to-member type, produce a null value of the right type.
      
      This fixes a bug where throwing an exception of type nullptr_t and catching it
      as a pointer-to-member would not guarantee to produce a null value in the catch
      handler. The fix is pretty simple: we statically allocate a constant null
      pointer-to-data-member representation and a constant null
      pointer-to-member-function representation, and produce the address of the
      relevant value as the adjusted pointer for the exception.
      
      llvm-svn: 276016
      2f984cab
    • Vedant Kumar's avatar
      [tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda* · 57faf2d2
      Vedant Kumar authored
      r274801 did not go far enough to allow gcov+tsan to cooperate. With this
      commit it's possible to run the following code without false positives:
      
        std::thread T1(fib), T2(fib);
        T1.join(); T2.join();
      
      llvm-svn: 276015
      57faf2d2
    • David Majnemer's avatar
      Let FuncAttrs infer the 'returned' argument attribute · 24547108
      David Majnemer authored
      This reverts commit r275756.
      
      llvm-svn: 276014
      24547108
    • Tim Northover's avatar
      ARM: move feature for Thumb2 pkhbt/pkhtb onto architectures. · 554fbd05
      Tim Northover authored
      There's not much functional change, but it really is an architectural feature
      (on v6T2, v7A, v7R and v7EM) rather than something each CPU implements
      individually.
      
      The main functional change is the default behaviour you get when specifying
      only "-triple".
      
      llvm-svn: 276013
      554fbd05
    • Ahmed Bougacha's avatar
      [GlobalISel] Mark newly-created gvregs as having a bank. · 5a59b24b
      Ahmed Bougacha authored
      Also verify that we never try to set the size of a vreg associated
      to a register class.
      
      Report an error when we encounter that in MIR. Fix a testcase that
      hit that error and had a size for no reason.
      
      llvm-svn: 276012
      5a59b24b
    • Ahmed Bougacha's avatar
      [GlobalISel] Simplify more RegClassOrRegBank is+get. NFC. · 0313a08a
      Ahmed Bougacha authored
      llvm-svn: 276011
      0313a08a
    • Yaxun Liu's avatar
      [OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target · f2e8ab25
      Yaxun Liu authored
      Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn.
      
      Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL.
      
      Patch by Aaron En Ye Shi.
      
      Differential Revision: https://reviews.llvm.org/D22424
      
      llvm-svn: 276010
      f2e8ab25
    • Matt Arsenault's avatar
      amdgpu: Use right builtn for rsq · 633d749d
      Matt Arsenault authored
      The r600 path has never actually worked sinced double is not implemented
      there.
      
      llvm-svn: 276009
      633d749d
    • David Majnemer's avatar
      [FunctionAttrs] Correct the safety analysis for inference of 'returned' · 5246e0b2
      David Majnemer authored
      We skipped over ReturnInsts which didn't return an argument which would
      lead us to incorrectly conclude that an argument returned by another
      ReturnInst was 'returned'.
      
      This reverts commit r275756.
      
      This fixes PR28610.
      
      llvm-svn: 276008
      5246e0b2
    • Davide Italiano's avatar
      [SCCP] Improve assert messages. NFCI. · 63266b6b
      Davide Italiano authored
      I've been hitting those already while working on SCCP and I think
      it's be useful to provide a more explanatory diagnostic.
      
      llvm-svn: 276007
      63266b6b
    • Kostya Serebryany's avatar
      [libFuzzer] properly intercept memmem · 6b08be92
      Kostya Serebryany authored
      llvm-svn: 276006
      6b08be92
    • Chad Rosier's avatar
      [DSE] Add additional debug output. NFC. · 8b5fa7a2
      Chad Rosier authored
      llvm-svn: 276005
      8b5fa7a2
    • Vitaly Buka's avatar
      Add detect_stack_use_after_scope runtime flag · 9f9c089f
      Vitaly Buka authored
      Summary: This flag could be used to disable check in runtime.
      
      Subscribers: kubabrecka
      
      Differential Revision: https://reviews.llvm.org/D22495
      
      llvm-svn: 276004
      9f9c089f
    • Eric Fiselier's avatar
      Fix undefined behavior in __tree · d05b10ab
      Eric Fiselier authored
      Summary:
      This patch attempts to fix the undefined behavior in __tree by changing the node pointer types used throughout. The pointer types are changed for raw pointers in the current ABI and for fancy pointers in ABI V2 (since the fancy pointer types may not be ABI compatible).
      
      The UB in `__tree` arises because tree downcasts the embedded end node and then deferences that pointer. Currently there are 3 node types in __tree.
      
      * `__tree_end_node` which contains the `__left_` pointer. This node is embedded within the container.
      * `__tree_node_base` which contains `__right_`, `__parent_` and `__is_black`. This node is used throughout the tree rebalancing algorithms.
      * `__tree_node` which contains `__value_`.
      
      Currently `__tree` stores the start of the tree, `__begin_node_`, as a pointer to a `__tree_node`. Additionally the iterators store their position as a pointer to a `__tree_node`. In both of these cases the pointee can be the end node. This is fixed by changing them to store `__tree_end_node` pointers instead.
      
      To make this change I introduced an `__iter_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node` in the current one.
      Both `__tree::__begin_node_` and iterator pointers are now stored as `__iter_pointers`.
      
      The other situation where `__tree_end_node` is stored as the wrong type is in `__tree_node_base::__parent_`.  Currently `__left_`, `__right_`, and `__parent_` are all `__tree_node_base` pointers. Since the end node will only be stored in `__parent_` the fix is to change `__parent_` to be a pointer to `__tree_end_node`.
      
      To make this change I introduced a `__parent_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node_base` in the current one.
      
      Note that in the new ABI `__iter_pointer` and `__parent_pointer` are the same type (but not in the old one). The confusion between these two types is unfortunate but it was the best solution I could come up with that maintains the ABI.
      
      The typedef changes force a ton of explicit type casts to correct pointer types and to make current code compatible with both the old and new pointer typedefs. This is the bulk of the change and it's really messy. Unfortunately I don't know how to avoid it.
      
      Please let me know what you think.
      
      
      
      
      
      Reviewers: howard.hinnant, mclow.lists
      
      Subscribers: howard.hinnant, bbannier, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D20786
      
      llvm-svn: 276003
      d05b10ab
    • David Majnemer's avatar
      Add a testcase for r275581 · 07ea3442
      David Majnemer authored
      llvm-svn: 276002
      07ea3442
    • David Majnemer's avatar
      [RegionInfo] Some cleanups · 938a6c7c
      David Majnemer authored
      - Use unique_ptr instead of managing a container of new'd pointers.
      - Use range based for loops.
      
      No functional change is intended.
      
      llvm-svn: 276001
      938a6c7c
    • David Majnemer's avatar
      [RegionPass] Some minor cleanups · f29b7baf
      David Majnemer authored
      No functional change is intended.
      
      llvm-svn: 276000
      f29b7baf
    • David Majnemer's avatar
      [LoopPass] Some minor cleanups · 1a4576e7
      David Majnemer authored
      No functional change is intended.
      
      llvm-svn: 275999
      1a4576e7
    • Aaron Ballman's avatar
      This code block breaks the docs build... · 887ad0e9
      Aaron Ballman authored
      This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11920/steps/docs-llvm-html/logs/stdio), but I cannot see anything immediately wrong with it and cannot reproduce the diagnostic locally. Setting the code highlighting to none instead of nasm to hopefully get the bot stumbling back towards green.
      
      llvm-svn: 275998
      887ad0e9
    • Ed Maste's avatar
      libunwind: sync some coments with NetBSD's version · 5c5e5145
      Ed Maste authored
      NetBSD's system unwinder is a modified version of LLVM's libunwind.
      Slightly reduce diffs by updating comments to match theirs where
      appropriate.
      
      llvm-svn: 275997
      5c5e5145
    • Ed Maste's avatar
      libunwind: Use conventional DWARF capitalization in comments and errors · c073b1ba
      Ed Maste authored
      llvm-svn: 275996
      c073b1ba
    • Sanjay Patel's avatar
      add tests related to PR28466 · 8b76ebe5
      Sanjay Patel authored
      llvm-svn: 275995
      8b76ebe5
    • Simon Pilgrim's avatar
      [X86][AVX512] Added AVX512 subvector broadcast tests · 5366d0e0
      Simon Pilgrim authored
      llvm-svn: 275994
      5366d0e0
    • Matthias Gehre's avatar
      cppcoreguidelines-pro-bounds-constant-array-index: ignore implicit constructor · dd117cf0
      Matthias Gehre authored
      Summary:
      The code
      
        struct A {
          int x[3];
        };
      
      gets an compiler-generated copy constructor that uses ArraySubscriptExpr (see below).
      Previously, the check would generate a warning on that copy constructor.
      This commit disables the warning on implicitly generated code.
      AST:
      
        |-CXXConstructorDecl 0x337b3c8 <col:8> col:8 implicit used constexpr A 'void (const struct A &) noexcept' inline
        | |-ParmVarDecl 0x337b510 <col:8> col:8 used 'const struct A &'
        | |-CXXCtorInitializer Field 0x3379238 'x' 'int [3]'
        | | `-ImplicitCastExpr 0x337e158 <col:8> 'int' <LValueToRValue>
        | |   `-ArraySubscriptExpr 0x337e130 <col:8> 'const int' lvalue
        | |     |-ImplicitCastExpr 0x337e118 <col:8> 'const int *' <ArrayToPointerDecay>
        | |     | `-MemberExpr 0x337dfc8 <col:8> 'int const[3]' lvalue .x 0x3379238
        | |     |   `-DeclRefExpr 0x337dfa0 <col:8> 'const struct A' lvalue ParmVar 0x337b510 '' 'const struct A &'
        | |     `-ImplicitCastExpr 0x337e098 <col:8> 'unsigned long' <LValueToRValue>
        | |       `-DeclRefExpr 0x337e070 <col:8> 'unsigned long' lvalue Var 0x337e010 '__i0' 'unsigned long'
      
      Reviewers: alexfh, aaron.ballman
      
      Subscribers: aemerson, nemanjai, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D22381
      
      llvm-svn: 275993
      dd117cf0
    • Simon Pilgrim's avatar
      [X86][AVX] Fixed typo in test names · f2d02cb0
      Simon Pilgrim authored
      llvm-svn: 275992
      f2d02cb0
    • Chad Rosier's avatar
      [DSE] Add additional debug output. NFC. · 667b1ca0
      Chad Rosier authored
      llvm-svn: 275991
      667b1ca0
    • Sanjay Patel's avatar
      add missing test for simplifySelectBitTest() · d2ff6d72
      Sanjay Patel authored
      llvm-svn: 275990
      d2ff6d72
    • Tobias Grosser's avatar
      [InstCombine] Enable cast-folding in logic(cast(icmp), cast(icmp)) · 1c382622
      Tobias Grosser authored
      Summary:
      Currently, InstCombine is already able to fold expressions of the form `logic(cast(A), cast(B))` to the simpler form `cast(logic(A, B))`, where logic designates one of `and`/`or`/`xor`. This transformation is implemented in `foldCastedBitwiseLogic()` in InstCombineAndOrXor.cpp. However, this optimization will not be performed if both `A` and `B` are `icmp` instructions. The decision to preclude casts of `icmp` instructions originates in r48715 in combination with r261707, and can be best understood by the title of the former one:
      
      > Transform (zext (or (icmp), (icmp))) to (or (zext (cimp), (zext icmp))) if at least one of the (zext icmp) can be transformed to eliminate an icmp.
      
      Apparently, it introduced a transformation that is a reverse of the transformation that is done in `foldCastedBitwiseLogic()`. Its purpose is to expose pairs of `zext icmp` that would subsequently be optimized by `transformZExtICmp()` in InstCombineCasts.cpp. Therefore, in order to avoid an endless loop of switching back and forth between these two transformations, the one in `foldCastedBitwiseLogic()` has been restricted to exclude `icmp` instructions which is mirrored in the responsible check:
      
      `if ((!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src)) && ...`
      
      This check seems to sort out more cases than necessary because:
      - the reverse transformation is obviously done for `or` instructions only
      - and also not every `zext icmp` pair is necessarily the result of this reverse transformation
      
      Therefore we now remove this check and replace it by a more finegrained one in `shouldOptimizeCast()` that now rejects only those `logic(zext(icmp), zext(icmp))` that would be able to be optimized by `transformZExtICmp()`, which also avoids the mentioned endless loop. That means we are now able to also simplify expressions of the form `logic(cast(icmp), cast(icmp))` to `cast(logic(icmp, icmp))` (`cast` being an arbitrary `CastInst`).
      
      As an example, consider the following IR snippet
      
      ```
      %1 = icmp sgt i64 %a, %b
      %2 = zext i1 %1 to i8
      %3 = icmp slt i64 %a, %c
      %4 = zext i1 %3 to i8
      %5 = and i8 %2, %4
      ```
      
      which would now be transformed to
      
      ```
      %1 = icmp sgt i64 %a, %b
      %2 = icmp slt i64 %a, %c
      %3 = and i1 %1, %2
      %4 = zext i1 %3 to i8
      ```
      
      This issue became apparent when experimenting with the programming language Julia, which makes use of LLVM. Currently, Julia lowers its `Bool` datatype to LLVM's `i8` (also see https://github.com/JuliaLang/julia/pull/17225). In fact, the above IR example is the lowered form of the Julia snippet `(a > b) & (a < c)`. Like shown above, this may introduce `zext` operations, casting between `i1` and `i8`, which could for example hinder ScalarEvolution and Polly on certain code.
      
      Reviewers: grosser, vtjnash, majnemer
      
      Subscribers: majnemer, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D22511
      
      Contributed-by: Matthias Reisinger
      llvm-svn: 275989
      1c382622
    • Matt Arsenault's avatar
      AMDGPU: Only use legal inline immediates with kill pseudo · 03006fd3
      Matt Arsenault authored
      Only if the value is negative or positive is what matters,
      so use a constant that doesn't require an instruction to
      materialize.
      
      These should really just emit the write exec directly,
      but for stick with the kill pseudo-terminator.
      
      llvm-svn: 275988
      03006fd3
    • Tobias Grosser's avatar
      GPGPU: Bail out of scops with hoisted invariant loads · 2d58a64e
      Tobias Grosser authored
      This is currently not supported and will only be added later. Also update the
      test cases to ensure no invariant code hoisting is applied.
      
      llvm-svn: 275987
      2d58a64e
    • NAKAMURA Takumi's avatar
      clangRename: Update libdeps to add clangASTMatchers. · ccf48a27
      NAKAMURA Takumi authored
      Note, ClangRenameTests is linking USRFindingAction.cpp directly.
      
      llvm-svn: 275986
      ccf48a27
    • NAKAMURA Takumi's avatar
      5541c8f4
Loading