1. Jul 29, 2019
    • Hans Wennborg's avatar
      Mark test/MC/RISCV/rv{32,64}i-aliases-invalid.s unsupported also on Windows · ecd137c7
      Hans Wennborg authored
      Because they fail there too.
      
      FAIL: LLVM :: MC/RISCV/rv32i-aliases-invalid.s (24397 of 32659)
      ******************** TEST 'LLVM :: MC/RISCV/rv32i-aliases-invalid.s' FAILED ********************
      Script:
      --
      : 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
      : 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s -triple=riscv32 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s
      --
      Exit Code: 1
      
      Command Output (stdout):
      --
      $ ":" "RUN: at line 2"
      $ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s" "-triple=riscv32" "-riscv-no-aliases"
      $ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s"
      C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv32i-aliases-invalid.s:10:21: error: CHECK: expected string not found in input
      li t4, foo # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-2147483648, 4294967295]
                          ^
      <stdin>:5:1: note: scanning from here
      li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-2147483648, 4294967295]
      ^
      <stdin>:5:1: note: with "@LINE" equal to "10"
      li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-2147483648, 4294967295]
      ^
      <stdin>:5:38: note: possible intended match here
      li x0, -2147483649 # CHECK: :[[@LINE]]:8: error: immediate must be an integer in the range [-2147483648, 4294967295]
                                           ^
      
      error: command failed with exit status: 1
      
      --
      
      --
      ********************
      Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70
      FAIL: LLVM :: MC/RISCV/rv64i-aliases-invalid.s (24416 of 32659)
      ******************** TEST 'LLVM :: MC/RISCV/rv64i-aliases-invalid.s' FAILED ********************
      Script:
      --
      : 'RUN: at line 2';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 -riscv-no-aliases 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
      : 'RUN: at line 3';   not c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s -triple=riscv64 2>&1 | c:\src\llvm.monorepo\build.release2\bin\filecheck.exe C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s
      --
      Exit Code: 1
      
      Command Output (stdout):
      --
      $ ":" "RUN: at line 2"
      $ "not" "c:\src\llvm.monorepo\build.release2\bin\llvm-mc.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s" "-triple=riscv64" "-riscv-no-aliases"
      $ "c:\src\llvm.monorepo\build.release2\bin\filecheck.exe" "C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s"
      C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:6:21: error: CHECK: expected string not found in input
      li t4, foo # CHECK: :[[@LINE]]:8: error: operand must be a constant 64-bit integer
                          ^
      <stdin>:2:1: note: scanning from here
      li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
      ^
      <stdin>:2:1: note: with "@LINE" equal to "6"
      li t5, 0x10000000000000000 # CHECK: :[[@LINE]]:8: error: unknown operand
      ^
      <stdin>:13:67: note: possible intended match here
      C:\src\llvm.monorepo\llvm\test\MC\RISCV\rv64i-aliases-invalid.s:12:13: error: immediate must be an integer in the range [0, 63]
                                                                        ^
      
      error: command failed with exit status: 1
      llvm-svn: 367215
      ecd137c7
    • Simon Pilgrim's avatar
      [ARM] Regenerate rotation tests · adda256a
      Simon Pilgrim authored
      llvm-svn: 367214
      adda256a
    • Simon Pilgrim's avatar
      [AMDGPU] Regenerate v2i16 insertelement tests. · 251b546f
      Simon Pilgrim authored
      To help show the diffs from an upcoming SimplifyDemandedBits patch.
      
      llvm-svn: 367213
      251b546f
    • Sam Parker's avatar
      [NFC][ARM[ParallelDSP] Cleanup of BinOpChain · 414dd1c9
      Sam Parker authored
      - Remove some unused typedefs.
      - Rename BinOpChain struct to MulCandidate.
      - Remove the size method of MulCandidate.
      - Store only the first input of the ValueList provided to
        MulCandidate, as it's the only value we care about. This means we
        don't have to perform any ugly (and unnecessary) iterations of the 
        list later on.
      
      llvm-svn: 367208
      414dd1c9
    • Raphael Isemann's avatar
      [lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitter · 4e44c77a
      Raphael Isemann authored
      Splitting the different logic is cleaner and we it will be easier
      to implement the enum emitting (which otherwise would have to
      reimplement the Record parsing).
      
      llvm-svn: 367207
      4e44c77a
    • David Stuttard's avatar
      [AMDGPU] Enable v4f16 and above for v_pk_fma instructions · 20235ef3
      David Stuttard authored
      Summary:
      If isel is presented with <2 x half> vectors then it will correctly select
      v_pk_fma style instructions.
      If isel is presented with e.g. <4 x half> vectors it will scalarize, unlike for
      other instruction types (such as fadd, fmul etc.)
      
      Added extra support to enable this. Updated one of the tests to include a test
      for this (as well as extending the test to GFX9)
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D65325
      
      Change-Id: I50a4577a3f8223fb53992af3b7d26121f65b71ee
      llvm-svn: 367206
      20235ef3
    • Sam Parker's avatar
      [NFC][ARM][ParallelDSP] Remove AreSymmetrical · 85380601
      Sam Parker authored
      We explicitly search for a parallel mac and we only care about its
      inputs, checking for symmetry doesn't add anything here.
      
      llvm-svn: 367205
      85380601
    • Sam Parker's avatar
      [NFC][ARM][ParallelDSP] Remove PopulateLoads · 11ad33ed
      Sam Parker authored
      We no longer have to check what loads are used, all this
      is performed at the start of the transform, so it's not
      doing anything now.
      
      llvm-svn: 367204
      11ad33ed
    • George Rimar's avatar
      [obj2yaml] - Report a error when unable to resolve a sh_link reference properly. · aef03e86
      George Rimar authored
      Because of a bug we did not report a error in the case
      shown in the test. With this patch we do.
      
      Differential revision: https://reviews.llvm.org/D65214
      
      llvm-svn: 367203
      aef03e86
    • George Rimar's avatar
      [llvm-objcopy] - Reimplement strip-dwo-groups.test to stop using the precompiled object. · 99f73ebe
      George Rimar authored
      When llvm-copy removes .dwo sections the index of symbol table,
      the indices of the symbols and the indices of the sections which go
      after the removed ones changes. That affects on SHT_GROUP sections,
      which needs to be updated.
      
      Initially this test used a precompiled object, I rewrote it to use YAML
      and improved a bit.
      
      Differential revision: https://reviews.llvm.org/D65273
      
      llvm-svn: 367202
      99f73ebe
    • Raphael Isemann's avatar
      [lldb][NFC] Remove DiagnosticManager::CopyDiagnostics · 822c5870
      Raphael Isemann authored
      The Diagnostic class in LLDB is suppossed to be inherited from,
      so just copying the diagnostics like this is wrong. The function
      is also unused, so lets just get rid of it instead of creating
      some cloning facility for it.
      
      llvm-svn: 367201
      822c5870
    • Rui Ueyama's avatar
      Return early. NFC. · d524c170
      Rui Ueyama authored
      llvm-svn: 367200
      d524c170
    • Mike Spertus's avatar
      Improve MSVC visualizers for DeclSpec and TemplateName · 9aeab53e
      Mike Spertus authored
      DeclSpec now shows the TypeRep, ExprRep, or DeclRep as appropriate
      TemplateName decodes and displays the StorageType
      A few minor refinements to other types
      
      llvm-svn: 367199
      9aeab53e
    • Craig Topper's avatar
      [X86] Don't use PMADDWD for vector add reductions of multiplies if the mul... · eb1beaba
      Craig Topper authored
      [X86] Don't use PMADDWD for vector add reductions of multiplies if the mul inputs have an additional user.
      
      The pmaddwd inserts a truncate, if that truncate would end up
      creating additional instructions instead of making a zext
      narrower, then we shouldn't do it.
      
      I've restricted this to only sse4.1 targets since on prior
      targets the zext will be done in stages. So the truncate will
      probably not create additional instructions. Might need some
      more investigation of mul shrinking and the other pmaddwd
      transform to be sure this is the right decision.
      
      There might be a slight regression on AVX1 targets due to add
      splitting. Hard to say for sure. Maybe we need to look into
      using the vector reduction flag to use 2 narrow loads and a
      blend instead of extracting and inserting.
      
      llvm-svn: 367198
      eb1beaba
    • Craig Topper's avatar
      ac9d0f41
    • Roman Lebedev's avatar
    • Craig Topper's avatar
      [X86] In combineLoopMAddPattern and combineLoopSADPattern, preserve the vector... · 894916ca
      Craig Topper authored
      [X86] In combineLoopMAddPattern and combineLoopSADPattern, preserve the vector reduction flag on the final add. Handle unrolled loops by letting DAG combine revisit.
      
      This reverts r340478 and r340631 and replaces them with a simpler
      method of just letting DAG combine revisit the nodes to handle
      the other operand.
      
      llvm-svn: 367195
      894916ca
    • Sanjay Patel's avatar
      [InstCombine] fold fsub+fneg with fdiv/fmul between · 99c57c6d
      Sanjay Patel authored
      The backend already does this via isNegatibleForFree(),
      but we may want to alter the fneg IR canonicalizations
      that currently exist, so we need to try harder to fold
      fneg in IR to avoid regressions.
      
      llvm-svn: 367194
      99c57c6d
  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