1. May 06, 2020
    • Alina Sbirlea's avatar
      [MemorySSA] Make MemoryLocation unknown when phi translation cannot be performed. · 8e911545
      Alina Sbirlea authored
      Summary: When phi translation cannot be performed, be conservative and make the MemoryLocation unknown.
      
      Reviewers: george.burgess.iv
      
      Subscribers: Prazek, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79386
      8e911545
    • Siva Chandra Reddy's avatar
      [libc] Add no_sanitize("address") attribute to the getMPFRMatcher function. · fbaaa168
      Siva Chandra Reddy authored
      This dramtically reduces the run time of tests. For example,
      sincosf_test takes over 25 minutes without this attribute but only 8
      seconds with this attribute.
      fbaaa168
    • Davide Italiano's avatar
      [TestIndirectSymbol] This tests an Apple-specific feature. · d606dcc6
      Davide Italiano authored
      Remove a redundant check.
      d606dcc6
    • Davide Italiano's avatar
    • Sanjay Patel's avatar
      [ValueTracking] fix CannotBeNegativeZero() to disregard 'nsz' FMF · a954b8a3
      Sanjay Patel authored
      The 'nsz' flag is different than 'nnan' or 'ninf' in that it does not create poison.
      Make that explicit in the LangRef and fix ValueTracking analysis that misinterpreted
      the definition.
      
      This manifests as bugs in InstSimplify shown in the test diffs and as discussed in
      PR45778:
      https://bugs.llvm.org/show_bug.cgi?id=45778
      
      Differential Revision: https://reviews.llvm.org/D79422
      a954b8a3
    • River Riddle's avatar
    • River Riddle's avatar
      [mlir][DenseElementsAttr] Add support for opaque APFloat/APInt complex values. · 24ad3858
      River Riddle authored
      This revision allows for creating DenseElementsAttrs and accessing elements using std::complex<APInt>/std::complex<APFloat>. This allows for opaquely accessing and transforming complex values. This is used by the printer/parser to provide pretty printing for complex values. The form for complex values matches that of std::complex, i.e.:
      
      ```
      // `(` element `,` element `)`
      dense<(10,10)> : tensor<complex<i64>>
      ```
      
      Differential Revision: https://reviews.llvm.org/D79296
      24ad3858
    • River Riddle's avatar
      [mlir][DenseElementsAttr] Add support for ComplexType elements · da2a6f4e
      River Riddle authored
      This revision adds support for storing ComplexType elements inside of a DenseElementsAttr. We store complex objects as an array of two elements, matching the  definition of std::complex. There is no current attribute storage for ComplexType, but DenseElementsAttr provides API for access/creation using std::complex<>. Given that the internal implementation of DenseElementsAttr is already fairly opaque, the only real complexity here is in the printing/parsing. This revision keeps it simple for now and always uses hex when printing complex elements. A followup will add prettier syntax for this.
      
      Differential Revision: https://reviews.llvm.org/D79281
      da2a6f4e
    • Stephen Neuendorffer's avatar
      [MLIR] mlir-opt needs PUBLIC dependence · c296d2dc
      Stephen Neuendorffer authored
      We see intermittent build errors on the windows buildbot because
      mlir-opt is including Linalg headers which haven't been built yet.
      This dependence should be resolved by declaring a PUBLIC dependence
      on the Linalg library when building MLIROptMain.
      c296d2dc
    • Michael Liao's avatar
      [clang][codegen] Hoist parameter attribute setting in function prolog. · 9142c0b4
      Michael Liao authored
      Summary:
      - If the coerced type is still a pointer, it should be set with proper
        parameter attributes, such as `noalias`, `nonnull`, and etc. Hoist
        that (pointer) parameter attribute setting so that the coerced pointer
        parameter could be marked properly.
      
      Depends on D79394
      
      Reviewers: rjmccall, kerbowa, yaxunl
      
      Subscribers: jvesely, nhaehnle, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D79395
      9142c0b4
    • Michael Liao's avatar
      [clang][codegen] Refactor argument loading in function prolog. NFC. · 276c8dde
      Michael Liao authored
      Summary:
      - Skip copying function arguments and unnecessary casting by using them
        directly.
      
      Reviewers: rjmccall, kerbowa, yaxunl
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D79394
      276c8dde
    • Erik Pilkington's avatar
      [AST] Print fixed enum type regardless of language mode · 86e50af7
      Erik Pilkington authored
      These are permitted in all language modes, not just C++11.
      86e50af7
    • Erik Pilkington's avatar
      [SemaObjC] Add a warning for dictionary literals with duplicate keys · 873e2790
      Erik Pilkington authored
      Duplicate keys in a literal break NSDictionary's invariants. rdar://50454461A
      
      Differential revision: https://reviews.llvm.org/D78660
      873e2790
    • Lei Zhang's avatar
      [mlir] Specify CMAKE_CXX_STANDARD to standalone dialect · 6f790f78
      Lei Zhang authored
      This addresses a compilation failure on GCC 5:
      
      error: #error This file requires compiler and library support for the
      ISO C++ 2011 standard. This support must be enabled with the -std=c++11
      or -std=gnu++11 compiler options.
       #error This file requires compiler and library support
      
      Differential Revision: https://reviews.llvm.org/D79439
      6f790f78
    • Christudasan Devadasan's avatar
      b8a616ec
    • Alex Zinenko's avatar
      [mlir] Harden verifiers for DMA ops · 9d273c0e
      Alex Zinenko authored
      DMA operation classes in the Standard dialect (`DmaStartOp` and `DmaWaitOp`)
      provide helper functions that make numerous assumptions about the number and
      order of operands, and about their types. However, these assumptions were not
      checked in the verifier, leading to assertion failures or crashes when helper
      functions were used on ill-formed ops. Some of the assuptions were checked in
      the custom parser (and thus could not check assumption violations in ops
      constructed programmatically, e.g., during rewrites) and others were not
      checked at all. Introduce the verifiers for all these assumptions and drop
      unnecessary checks in the parser that are now covered by the verifier.
      
      Addresses PR45560.
      
      Differential Revision: https://reviews.llvm.org/D79408
      9d273c0e
    • Tim Keith's avatar
      [flang] Fix bug in tests for standalone build · 0195b3a9
      Tim Keith authored
      When doing a standalone build of flang against an LLVM that contains a
      built flang, the tests were run on the flang from LLVM rather than on
      the one that was just built.
      
      The problem was in the lit configuration for finding %flang etc.
      Fix it to look only in the directory where it was built.
      
      Differential Revision: https://reviews.llvm.org/D79327
      0195b3a9
    • Momchil Velikov's avatar
      Revert "[ARM] CMSE code generation" · fb18dffa
      Momchil Velikov authored
      This reverts commit 7cbbf89d.
      
      The regression tests fail with the expensive checks.
      fb18dffa
    • David Blaikie's avatar
    • Kazu Hirata's avatar
      [Inlining] Teach shouldBeDeferred to take the total cost into account · e8984fe6
      Kazu Hirata authored
      Summary:
      This patch teaches shouldBeDeferred to take into account the total
      cost of inlining.
      
      Suppose we have a call hierarchy {A1,A2,A3,...}->B->C.  (Each of A1,
      A2, A3, ... calls B, which in turn calls C.)
      
      Without this patch, shouldBeDeferred essentially returns true if
      
        TotalSecondaryCost < IC.getCost()
      
      where TotalSecondaryCost is the total cost of inlining B into As.
      This means that if B is a small wraper function, for example, it would
      get inlined into all of As.  In turn, C gets inlined into all of As.
      In other words, shouldBeDeferred ignores the cost of inlining C into
      each of As.
      
      This patch adds an option, inline-deferral-scale, to replace the
      expression above with:
      
        TotalCost < Allowance
      
      where
      
      - TotalCost is TotalSecondaryCost + IC.getCost() * # of As, and
      - Allowance is IC.getCost() * Scale
      
      For now, the new option defaults to -1, disabling the new scheme.
      
      Reviewers: davidxl
      
      Subscribers: eraman, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79138
      e8984fe6
    • Jonas Devlieghere's avatar
      [lldb/Driver] Exit with a non-zero exit code in case of error in batch mode. · 61d5b0e6
      Jonas Devlieghere authored
      We have the option to stop running commands in batch mode when an error
      occurs. When that happens we should exit the driver with a non-zero exit
      code.
      
      Differential revision: https://reviews.llvm.org/D78825
      61d5b0e6
    • Nico Weber's avatar
      Let normalize() for posix style convert backslash to slash unconditionally. · 8fc7a907
      Nico Weber authored
      Currently, normalize() for posix replaces backslashes to slashes, except
      that two backslashes in sequence are kept as-is.
      
      clang calls normalize() to convert \ to / is microsoft compat mode. This
      generally works well, but a path like "c:\\foo\\bar.h" with two
      backslashes doesn't work due to the exception in normalize().
      
      These paths happen naturally on Windows hosts with e.g.
      `#include __FILE__`, and them not working on other hosts makes it
      more difficult to write tests for this case.
      
      The special case has been around without justification since this code
      was added in r203611 (since then moved around in r215241 r215243).  No
      integration tests fail if I remove it.
      
      Try removing the special case.
      
      Differential Revision: https://reviews.llvm.org/D79265
      8fc7a907
    • Andy Davis's avatar
      [MLIR][LoopOps] Adds the loop unroll transformation for loop::ForOp. · 93d11088
      Andy Davis authored
      Summary:
      Adds the loop unroll transformation for loop::ForOp.
      Adds support for promoting the body of single-iteration loop::ForOps into its containing block.
      Adds check tests for loop::ForOps with dynamic and static lower/upper bounds and step.
      Care was taken to share code (where possible) with the AffineForOp unroll transformation to ease maintenance and potential future transition to a LoopLike construct on which loop transformations for different loop types can implemented.
      
      Reviewers: ftynse, nicolasvasilache
      
      Reviewed By: ftynse
      
      Subscribers: bondhugula, mgorny, zzheng, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79184
      93d11088
    • Nico Weber's avatar
      Add a test to Support.NormalizePath. · 6bb68fdd
      Nico Weber authored
      6bb68fdd
    • Christudasan Devadasan's avatar
      [AMDGPU] Introduce more scratch registers in the ABI. · 375cec4b
      Christudasan Devadasan authored
      The AMDGPU target has a convention that defined all VGPRs
      (execept the initial 32 argument registers) as callee-saved.
      This convention is not efficient always, esp. when the callee
      requiring more registers, ended up emitting a large number of
      spills, even though its caller requires only a few.
      
      This patch revises the ABI by introducing more scratch registers
      that a callee can freely use.
      The 256 vgpr registers now become:
        32 argument registers
        112 scratch registers and
        112 callee saved registers.
      The scratch registers and the CSRs are intermixed at regular
      intervals (a split boundary of 8) to obtain a better occupancy.
      
      Reviewers: arsenm, t-tye, rampitec, b-sumner, mjbedy, tpr
      
      Reviewed By: arsenm, t-tye
      
      Differential Revision: https://reviews.llvm.org/D76356
      375cec4b
    • Lei Zhang's avatar
      [mlir] Add missing dependency to MLIRMlirOptMain · 6fb7e9a1
      Lei Zhang authored
      Differential Revision: https://reviews.llvm.org/D79429
      6fb7e9a1
    • Louis Dionne's avatar
      [libc++] Rewrite the tests for cin, cout, clog, cerr and friends · 50cd964e
      Louis Dionne authored
      The tests were disabled with `#if 0`, most likely because there was no
      way of writing shell tests when they were first written.
      50cd964e
    • Siva Chandra Reddy's avatar
      [libc] Improve information printed on failure of a math test which uses MPFR. · d69cbd82
      Siva Chandra Reddy authored
      A new test matcher class MPFRMatcher is added along with helper macros
      EXPECT|ASSERT_MPFR_MATCH.
      
      New type traits classes RemoveCV and IsFloatingPointType have been
      added and used to implement the above class and its helpers.
      
      Reviewers: abrachet, phosek
      
      Differential Revision: https://reviews.llvm.org/D79256
      d69cbd82
    • Momchil Velikov's avatar
      [ARM] CMSE code generation · 7cbbf89d
      Momchil Velikov authored
      This patch implements the final bits of CMSE code generation:
      
      * emit special linker symbols
      
      * restrict parameter passing to not use memory
      
      * emit BXNS and BLXNS instructions for returns from non-secure entry
        functions, and non-secure function calls, respectively
      
      * emit code to save/restore secure floating-point state around calls
        to non-secure functions
      
      * emit code to save/restore non-secure floating-pointy state upon
        entry to non-secure entry function, and return to non-secure state
      
      * emit code to clobber registers not used for arguments and returns
        when switching to no-secure state
      
      Patch by Momchil Velikov, Bradley Smith, Javed Absar, David Green,
      possibly others.
      
      Differential Revision: https://reviews.llvm.org/D76518
      7cbbf89d
    • Louis Dionne's avatar
    • Stanislav Mekhanoshin's avatar
      9ef166e6
    • Hans Wennborg's avatar
      Don't assert about missing profile info in createProfileWeightsForLoop · 55b9b11f
      Hans Wennborg authored
      The compiler shouldn't crash if the profile info is slightly off. We hit
      this in Chromium.
      
      Differential revision: https://reviews.llvm.org/D79417
      55b9b11f
    • Sid Manning's avatar
      [Hexagon] Add R_HEX_GD_PLT_B22/32_PCREL relocations · 0e6536fd
      Sid Manning authored
      Extended versions of GD_PLT_B22_PCREL. These surface when -mlong-calls
      is used.
      
      Differential Revision: https://reviews.llvm.org/D79191
      0e6536fd
    • Sanjay Patel's avatar
      [SLP] add another bailout for load-combine patterns · 86dfbc67
      Sanjay Patel authored
      This builds on the or-reduction bailout that was added with D67841.
      We still do not have IR-level load combining, although that could
      be a target-specific enhancement for -vector-combiner.
      
      The heuristic is narrowly defined to catch the motivating case from
      PR39538:
      https://bugs.llvm.org/show_bug.cgi?id=39538
      ...while preserving existing functionality.
      
      That is, there's an unmodified test of pure load/zext/store that is
      not seen in this patch at llvm/test/Transforms/SLPVectorizer/X86/cast.ll.
      That's the reason for the logic difference to require the 'or'
      instructions. The chances that vectorization would actually help a
      memory-bound sequence like that seem small, but it looks nicer with:
      
        vpmovzxwd	(%rsi), %xmm0
        vmovdqu	%xmm0, (%rdi)
      
      rather than:
      
        movzwl	(%rsi), %eax
        movl	%eax, (%rdi)
        ...
      
      In the motivating test, we avoid creating a vector mess that is
      unrecoverable in the backend, and SDAG forms the expected bswap
      instructions after load combining:
      
        movzbl (%rdi), %eax
        vmovd %eax, %xmm0
        movzbl 1(%rdi), %eax
        vmovd %eax, %xmm1
        movzbl 2(%rdi), %eax
        vpinsrb $4, 4(%rdi), %xmm0, %xmm0
        vpinsrb $8, 8(%rdi), %xmm0, %xmm0
        vpinsrb $12, 12(%rdi), %xmm0, %xmm0
        vmovd %eax, %xmm2
        movzbl 3(%rdi), %eax
        vpinsrb $1, 5(%rdi), %xmm1, %xmm1
        vpinsrb $2, 9(%rdi), %xmm1, %xmm1
        vpinsrb $3, 13(%rdi), %xmm1, %xmm1
        vpslld $24, %xmm0, %xmm0
        vpmovzxbd %xmm1, %xmm1 # xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
        vpslld $16, %xmm1, %xmm1
        vpor %xmm0, %xmm1, %xmm0
        vpinsrb $1, 6(%rdi), %xmm2, %xmm1
        vmovd %eax, %xmm2
        vpinsrb $2, 10(%rdi), %xmm1, %xmm1
        vpinsrb $3, 14(%rdi), %xmm1, %xmm1
        vpinsrb $1, 7(%rdi), %xmm2, %xmm2
        vpinsrb $2, 11(%rdi), %xmm2, %xmm2
        vpmovzxbd %xmm1, %xmm1 # xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
        vpinsrb $3, 15(%rdi), %xmm2, %xmm2
        vpslld $8, %xmm1, %xmm1
        vpmovzxbd %xmm2, %xmm2 # xmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero,xmm2[2],zero,zero,zero,xmm2[3],zero,zero,zero
        vpor %xmm2, %xmm1, %xmm1
        vpor %xmm1, %xmm0, %xmm0
        vmovdqu %xmm0, (%rsi)
      
        movl	(%rdi), %eax
        movl	4(%rdi), %ecx
        movl	8(%rdi), %edx
        movbel	%eax, (%rsi)
        movbel	%ecx, 4(%rsi)
        movl	12(%rdi), %ecx
        movbel	%edx, 8(%rsi)
        movbel	%ecx, 12(%rsi)
      
      Differential Revision: https://reviews.llvm.org/D78997
      86dfbc67
    • Pete Steinfeld's avatar
      [flang] New implementation for checks for constraints C741 through C750 · 8d0c3c05
      Pete Steinfeld authored
      Summary:
      Most of these checks were already implemented, and I just added references to
      them to the code and tests. Also, much of this code was already
      reviewed in the old flang/f18 GitHub repository, but I didn't get to
      merge it before we switched repositories.
      
      I implemented the check for C747 to not allow coarray components in derived
      types that are of type C_PTR, C_FUNPTR, or type TEAM_TYPE.
      
      I implemented the check for C748 that requires a data component whose type has
      a coarray ultimate component to be a nonpointer, nonallocatable scalar and not
      be a coarray.
      
      I implemented the check for C750 that adds additional restrictions to the
      bounds expressions of a derived type component that's an array.
      These bounds expressions are sepcification expressions as defined in
      10.1.11.  There was already code in lib/Evaluate/check-expression.cpp to
      check semantics for specification expressions, but it did not check for
      the extra requirements of C750.
      
      C750 prohibits specification functions, the intrinsic functions
      ALLOCATED, ASSOCIATED, EXTENDS_TYPE_OF, PRESENT, and SAME_TYPE_AS. It
      also requires every specification inquiry reference to be a constant
      expression, and requires that the value of the bound not depend on the
      value of a variable.
      
      To implement these additional checks, I added code to the intrinsic proc
      table to get the intrinsic class of a procedure.  I also added an
      enumeration to distinguish between specification expressions for
      derived type component bounds versus for type parameters.  I then
      changed the code to pass an enumeration value to
      "CheckSpecificationExpr()" to indicate that the expression was a bounds
      expression and used this value to determine whether to emit an error
      message when violations of C750 are found.
      
      I changed the implementation of IsPureProcedure() to handle statement
      functions and changed some references in the code that tested for the
      PURE attribute to call IsPureProcedure().
      
      I also fixed some unrelated tests that got new errors when I implemented these
      new checks.
      
      Reviewers: tskeith, DavidTruby, sscalpone
      
      Subscribers: jfb, llvm-commits
      
      Tags: #llvm, #flang
      
      Differential Revision: https://reviews.llvm.org/D79263
      8d0c3c05
    • Francesco Petrogalli's avatar
      [clang][OpenMP] Fix getNDSWDS for aarch64. · 4fa13a3d
      Francesco Petrogalli authored
      Summary:
      This change fixes an aarch64-specific bug in the generation of the NDS and WDS values used to compute the signature of the vector functions out of OpenMP directives like `declare simd`. When the directive is used in conjunction with the `linear` clause, the size of the pointee must be used instead of the size of the pointer to compute NDS and WDS.
      
      The code-fix is strictly related to the behavior for `linear`, but given that the only way we have to test the NDS and WDS values is to check the resulting `<vlen>` token in the mangled name of the vector function, the tests have been extended to cover all the possible values of WDS and NDS as defined in the ABI at https://github.com/ARM-software/abi-aa/tree/master/vfabia64.
      
      Reviewers: ABataev, jdoerfert, andwar
      
      Reviewed By: jdoerfert
      
      Subscribers: yaxunl, kristof.beyls, guansong, danielkiss, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D78969
      4fa13a3d
    • Stephen Neuendorffer's avatar
      [MLIR] Add a tests for out of tree dialect example. · 175a3df9
      Stephen Neuendorffer authored
      This attempts to ensure that out of tree usage remains stable.
      
      Differential Revision: https://reviews.llvm.org/D78656
      175a3df9
    • Vedant Kumar's avatar
      c05f3544
    • Jinsong Ji's avatar
      [MachinePipeliner] Add ORE for MachinePipeliner · 80b78a47
      Jinsong Ji authored
      This patch adds ORE for MachinePipeliner, so that people can anaylyze
      their code using opt-viewer or other tools, then optimize the code to
      catch more piplining opportunities.
      
      Reviewed By: bcahoon
      
      Differential Revision: https://reviews.llvm.org/D79368
      80b78a47
  2. May 05, 2020