1. Jul 29, 2019
  2. Jul 28, 2019
    • Gabor Borsik's avatar
      Buildbot fix for r367190 · 2c809837
      Gabor Borsik authored
      llvm-svn: 367193
      2c809837
    • David Green's avatar
      [ARM] MVE VPNOT · b8b8b46a
      David Green authored
      This adds the patterns required to transform xor P0, -1 to a VPNOT. The
      instruction operands have to change a little for this, adding an in and an out
      VCCR reg and using a custom DecodeMVEVPNOT for the decode.
      
      Differential Revision: https://reviews.llvm.org/D65133
      
      llvm-svn: 367192
      b8b8b46a
    • David Green's avatar
      [ARM] Better patterns for fp <> predicate vectors · 9cf344e7
      David Green authored
      These are some better patterns for converting between predicates and floating
      points. Much like the extends, we select "1"/"-1" or "0" depending on the
      predicate value. Or we perform a compare against 0 to convert to a predicate.
      
      Differential Revision: https://reviews.llvm.org/D65103
      
      llvm-svn: 367191
      9cf344e7
    • Gabor Borsik's avatar
      [analyzer] Add yaml parser to GenericTaintChecker · 4bde15fe
      Gabor Borsik authored
      While we implemented taint propagation rules for several
      builtin/standard functions, there's a natural desire for users to add
      such rules to custom functions.
      
      A series of patches will implement an option that allows users to
      annotate their functions with taint propagation rules through a YAML
      file. This one adds parsing of the configuration file, which may be
      specified in the commands line with the analyzer config:
      alpha.security.taint.TaintPropagation:Config. The configuration may
      contain propagation rules, filter functions (remove taint) and sink
      functions (give a warning if it gets a tainted value).
      
      I also added a new header for future checkers to conveniently read YAML
      files as checker options.
      
      Differential Revision: https://reviews.llvm.org/D59555
      
      llvm-svn: 367190
      4bde15fe
    • Roman Lebedev's avatar
      d5bc4b09
    • Eugene Leviant's avatar
      Don't initialize interceptor_metadata_map unless SI_POSIX is set · 45d910de
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D64794
      
      llvm-svn: 367188
      45d910de
    • Hideto Ueno's avatar
      [Attributor] Deduce "align" attribute · e7bea9b7
      Hideto Ueno authored
      Summary:
      Deduce "align" attribute in attributor.
      
      Reviewers: jdoerfert, sstefan1
      
      Reviewed By: jdoerfert
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64152
      
      llvm-svn: 367187
      e7bea9b7
    • Raphael Isemann's avatar
      [lldb] Also include the array definition in CommandOptions.inc · bd68a052
      Raphael Isemann authored
      Summary:
      Right now our CommandOptions.inc only generates the initializer for the options list but
      not the array declaration boilerplate around it. As the array definition is identical for all arrays,
      we might as well also let the CommandOptions.inc generate it alongside the initializers.
      
      This patch will also allow us to generate additional declarations related to that option list in
      the future (e.g. a enum class representing the specific options which would make our
      handling code less prone).
      
      This patch also fixes a few option tables that didn't follow our naming style.
      
      Reviewers: JDevlieghere
      
      Reviewed By: JDevlieghere
      
      Subscribers: abidh, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D65331
      
      llvm-svn: 367186
      bd68a052
    • Hideto Ueno's avatar
      [IR] Fix getPointerAlignment for CallBase · afd4a37b
      Hideto Ueno authored
      Summary:
      In current getPointerAlignemnt implementation, CallBase.getPointerAlignement(..) checks only parameter attriutes in the callsite.  For example,
      
      ```
      declare align 8 i8* @foo()
      
      define void @bar() {
          %a = tail call align 8 i8* @foo() ; getPointerAlignment returns 8
          %b = tail call i8* @foo() ; getPointerAlignemnt returns 0
          ret void
      }
      ```
      
      This patch will fix the problem.
      
      Reviewers: jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65281
      
      llvm-svn: 367185
      afd4a37b
    • Hideto Ueno's avatar
      [FunctionAttrs] Annotate "willreturn" for intrinsics · cc0a4cdc
      Hideto Ueno authored
      Summary:
      In D62801, new function attribute `willreturn` was introduced. In short, a function with `willreturn` is guaranteed to come back to the call site(more precise definition is in LangRef).
      
      In this patch, willreturn is annotated for LLVM intrinsics.
      
      Reviewers: jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: jvesely, nhaehnle, sstefan1, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D64904
      
      llvm-svn: 367184
      cc0a4cdc
    • Eric Fiselier's avatar
      Fix PR35637: suboptimal codegen for `vector<unsigned char>`. · d4ace50e
      Eric Fiselier authored
      The optimizer is petulant and temperamental. In this case LLVM failed to lower
      the the "insert at end" loop used by`vector<unsigned char>` to a `memset` despite
      `memset` being substantially faster over a range of bytes.
      
      LLVM has the ability to lower loops to `memset` whet appropriate, but the
      odd nature of libc++'s loops prevented the optimization from taking places.
      
      This patch addresses the issue by rewriting the loops from the form
      `do [ ... --__n; } while (__n > 0);` to instead use a for loop over a pointer
      range (For example: `for (auto *__i = ...; __i < __e; ++__i)`).
      
      This patch also rewrites the asan annotations to unposion all additional memory
      at the start of the loop instead of once per iterations. This could potentially
      permit false negatives where the constructor of element N attempts to access
      element N + 1 during its construction.
      
      The before and after results for the `BM_ConstructSize/vector_byte/5140480_mean`
      benchmark (run 5 times) are:
      
      --------------------------------------------------------------------------------------------
      Benchmark                                                 Time             CPU   Iterations
      --------------------------------------------------------------------------------------------
      Before
      ------
      BM_ConstructSize/vector_byte/5140480_mean          12530140 ns     12469693 ns            N/A
      BM_ConstructSize/vector_byte/5140480_median        12512818 ns     12445571 ns            N/A
      BM_ConstructSize/vector_byte/5140480_stddev          106224 ns       107907 ns            5
      -----
      After
      -----
      BM_ConstructSize/vector_byte/5140480_mean            167285 ns       166500 ns            N/A
      BM_ConstructSize/vector_byte/5140480_median          166749 ns       166069 ns            N/A
      BM_ConstructSize/vector_byte/5140480_stddev            3242 ns         3184 ns            5
      
      llvm-svn: 367183
      d4ace50e
    • Bjorn Pettersson's avatar
      [Driver] Additional fixup of NOWARN test case from r367165 · 197c08d6
      Bjorn Pettersson authored
      Same kind of fix as in r367176, but for "RUN on line 76"
      this time.
      
      I'll ask for a post-commit review, to ensure this
      matches the intention with the test added in r367165.
      But I think this at least will make the buildbots a
      little bit happier.
      
      llvm-svn: 367182
      197c08d6
    • Simon Pilgrim's avatar
      [DAGCombine] narrowInsertExtractVectorBinOp - early out for illegal op. NFCI. · 76f2f04d
      Simon Pilgrim authored
      If the subvector binop is illegal then early-out and avoid the subvector searches.
      
      llvm-svn: 367181
      76f2f04d
    • Joerg Sonnenberger's avatar
      Stricter check for the memory access. · 791951bd
      Joerg Sonnenberger authored
      The current pattern would trigger for scheduling changes of the
      post-load computation, since those are commutable with the inline asm.
      Avoid this by explicitly check the order of load vs asm block.
      
      llvm-svn: 367180
      791951bd
    • Simon Pilgrim's avatar
      Regenerate UXTB tests · 37a32f3c
      Simon Pilgrim authored
      llvm-svn: 367179
      37a32f3c
    • Bjorn Pettersson's avatar
      [clangd] Fix NDEBUG build problem introduced by rL366698 · f0f63cab
      Bjorn Pettersson authored
      Sprinkled some #ifndef NDEBUG in Selection.cpp to make
      it possible to build with NDEBUG defined.
      
      The problem was introduced in rL366698 when using dlog
      for some debug printouts. The dlog macro expands to
      DEBUG_WITH_TYPE, which isn't using it's arguments in
      optimized builds (when NDEBUG is defined).
      
      llvm-svn: 367178
      f0f63cab
    • Bjorn Pettersson's avatar
      [Driver] Fix "unannotated fall-through between switch labels". NFC · 60c1ee23
      Bjorn Pettersson authored
      Just a simple fix of Werror problem after r367165.
      
      llvm-svn: 367177
      60c1ee23
    • Nico Weber's avatar
      Attempt to make test in r367165 more robust. · 464cb6c8
      Nico Weber authored
      Some people were seeing this failure:
      
      ```
      : 'RUN: at line 83';   clang -mrelax-all -fno-integrated-as /b/s/w/ir/k/llvm-project/clang/test/Driver/as-options.s -S 2>&1 \
               | /FileCheck --check-prefix=WARN --allow-empty clang/test/Driver/as-options.s
      --
      Exit Code: 1
      
      Command Output (stderr):
      --
      clang/test/Driver/as-options.s:66:16: error: NOWARN-NOT: excluded string found in input
      // NOWARN-NOT: unused
                     ^
      <stdin>:1:95: note: found here
      clang-10: warning: clang/test/Driver/as-options.s: 'assembler' input unused [-Wunused-command-line-argument]
      ```
      
      Maybe this helps with that.
      
      llvm-svn: 367176
      464cb6c8
  3. Jul 27, 2019
    • Simon Pilgrim's avatar
      [AMDGPU] Regenerate tests. · 062cd8bb
      Simon Pilgrim authored
      To help show the diffs from an upcoming SimplifyDemandedBits patch.
      
      llvm-svn: 367175
      062cd8bb
    • Simon Pilgrim's avatar
      [TargetLowering] SimplifyMultipleUseDemandedBits - add BITCAST pass through support (Reapplied) · 603f94aa
      Simon Pilgrim authored
      This allows us to peek through BITCASTs, attempt to simplify the source operand, and then bitcast back.
      
      This reapplies rL367091 which was reverted at rL367118 - we were inconsistently peeking through the bitcasts to the source value.
      
      Fixes PR42777
      
      llvm-svn: 367174
      603f94aa
    • Sanjay Patel's avatar
      [InstSimplify] remove quadratic time looping (PR42771) · 02b9e45a
      Sanjay Patel authored
      The test case from:
      https://bugs.llvm.org/show_bug.cgi?id=42771
      ...shows a ~30x slowdown caused by the awkward loop iteration (rL207302) that is
      seemingly done just to avoid invalidating the instruction iterator. We can instead
      delay instruction deletion until we reach the end of the block (or we could delay
      until we reach the end of all blocks).
      
      There's a test diff here for a degenerate case with llvm.assume that is not
      meaningful in itself, but serves to verify this change in logic.
      
      This change probably doesn't result in much overall compile-time improvement
      because we call '-instsimplify' as a standalone pass only once in the standard
      -O2 opt pipeline currently.
      
      Differential Revision: https://reviews.llvm.org/D65336
      
      llvm-svn: 367173
      02b9e45a
    • Simon Pilgrim's avatar
      [X86][SSE] Replace PMULDQ GetDemandedBits combine with... · 353a8484
      Simon Pilgrim authored
      [X86][SSE] Replace PMULDQ GetDemandedBits combine with SimplifyMultipleUseDemandedBits handler (Reapplied)
      
      Recommit rL367100 which was reverted at rL367141. Until PR42777 is fixed, we no longer get the benefits of peeking through bitcasts but it does still remove a GetDemandedBits user and gives us the equivalent combines.
      
      llvm-svn: 367172
      353a8484
    • Simon Pilgrim's avatar
      [SelectionDAG] Check for any recursion depth greater than or equal to limit... · 8a526717
      Simon Pilgrim authored
      [SelectionDAG] Check for any recursion depth greater than or equal to limit instead of just equal the limit.
      
      If anything called the recursive isKnownNeverNaN/computeKnownBits/ComputeNumSignBits/SimplifyDemandedBits/SimplifyMultipleUseDemandedBits with an incorrect depth then we could continue to recurse if we'd already exceeded the depth limit.
      
      This replaces the limit check (Depth == 6) with a (Depth >= 6) to make sure that we don't circumvent it. 
      
      This causes a couple of regressions as a mixture of calls (SimplifyMultipleUseDemandedBits + combineX86ShufflesRecursively) were calling with depths that were already over the limit. I've fixed SimplifyMultipleUseDemandedBits to not do this. combineX86ShufflesRecursively is trickier as we get a lot of regressions if we reduce its own limit from 8 to 6 (it also starts at Depth == 1 instead of Depth == 0 like the others....) - I'll see what I can do in future patches.
      
      llvm-svn: 367171
      8a526717