1. Jan 07, 2020
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Replace handling of boolean values · 4e85ca95
      Matt Arsenault authored
      This solves selection failures with generated selection patterns,
      which would fail due to inferring the SGPR reg bank for virtual
      registers with a set register class instead of VCC bank. Use
      instruction selection would constrain the virtual register to a
      specific class, so when the def was selected later the bank no longer
      was set to VCC.
      
      Remove the SCC reg bank. SCC isn't directly addressable, so it
      requires copying from SCC to an allocatable 32-bit register during
      selection, so these might as well be treated as 32-bit SGPR values.
      
      Now any scalar boolean value that will produce an outupt in SCC should
      be widened during RegBankSelect to s32. Any s1 value should be a
      vector boolean during selection. This makes the vcc register bank
      unambiguous with a normal SGPR during selection.
      
      Summary of how this should now work:
      
      - G_TRUNC is always a no-op, and never should use a vcc bank result.
      
      - SALU boolean operations should be promoted to s32 in RegBankSelect
        apply mapping
      
      - An s1 value means vcc bank at selection. The exception is for
        legalization artifacts that use s1, which are never VCC. All other
        contexts should infer the VCC register classes for s1 typed
        registers. The LLT for the register is now needed to infer the
        correct register class. Extensions with vcc sources should be
        legalized to a select of constants during RegBankSelect.
      
      - Copy from non-vcc to vcc ensures high bits of the input value are
        cleared during selection.
      
      - SALU boolean inputs should ensure the inputs are 0/1. This includes
        select, conditional branches, and carry-ins.
      
      There are a few somewhat dirty details. One is that G_TRUNC/G_*EXT
      selection ignores the usual register-bank from register class
      functions, and can't handle truncates with VCC result banks. I think
      this is OK, since the artifacts are specially treated anyway. This
      does require some care to avoid producing cases with vcc. There will
      also be no 100% reliable way to verify this rule is followed in
      selection in case of register classes, and violations manifests
      themselves as invalid copy instructions much later.
      
      Standard phi handling also only considers the bank of the result
      register, and doesn't insert copies to make the source banks
      match. This doesn't work for vcc, so we have to manually correct phi
      inputs in this case. We should add a verifier check to make sure there
      are no phis with mixed vcc and non-vcc register bank inputs.
      
      There's also some duplication with the LegalizerHelper, and some code
      which should live in the helper. I don't see a good way to share
      special knowledge about what types to use for intermediate operations
      depending on the bank for example. Using the helper to replace
      extensions with selects also seems somewhat awkward to me.
      
      Another issue is there are some contexts calling
      getRegBankFromRegClass that apparently don't have the LLT type for the
      register, but I haven't yet run into a real issue from this.
      
      This also introduces new unnecessary instructions in most cases, since
      we don't yet try to optimize out the zext when the source is known to
      come from a compare.
      4e85ca95
    • Matt Arsenault's avatar
      TableGen/GlobalISel: Handle default operands that are used · 26f714ff
      Matt Arsenault authored
      Copy the logic from the existing handling in the DAG matcher emittter.
      
      This will enable some AMDGPU pattern cleanups without breaking
      GlobalISel tests, and eventually handle importing more patterns.
      
      The test is a bit annoying since the sections seem to randomly sort
      themselves if anything else is added in the future.
      26f714ff
    • Matt Arsenault's avatar
      GlobalISel: Implement lower for G_INTRINSIC_ROUND · f3de8ab5
      Matt Arsenault authored
      Mostly copied from AMDGPU lowering implementation, except used
      G_SITOFP instead of directly creating a select on -1.0, 0.0.
      f3de8ab5
    • Jason Molenda's avatar
      Change the patterns to include the prefix '= ' so we don't pass errantly. · 450073c6
      Jason Molenda authored
      Looking at a sometimes-passing test case on a platform
      where random values were being returned - sometimes
      the expected digit ('1' or '2') would be included in the
      random returned value.  Add a prefix to reduce the likelihood of
      this a bit.
      450073c6
    • Philip Reames's avatar
    • Evgenii Stepanov's avatar
      [msan] Check qsort input. · b5e7f95c
      Evgenii Stepanov authored
      Summary:
      Qsort interceptor suppresses all checks by unpoisoning the data in the
      wrapper of a comparator function, and then unpoisoning the output array
      as well.
      
      This change adds an explicit run of the comparator on all elements of
      the input array to catch any sanitizer bugs.
      
      Reviewers: vitalybuka
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71780
      b5e7f95c
    • Davide Italiano's avatar
      [NSArray] Remove a very old and deprecated formatter. · 59fadc14
      Davide Italiano authored
      Checked with the Foundation folks.
      59fadc14
    • Petr Hosek's avatar
      [CMake] Pass symlink dependency to add_llvm_install_targets explicitly · 71a2a621
      Petr Hosek authored
      The install-${name}-stripped targets don't strip when ${name} is being
      symlinked, e.g. llvm-ar or llvm-objcopy. The problem is that
      llvm_install_symlink passes install-${dest} as a dependency of
      install-${name}, e.g. install-llvm-ar becomes a dependency of both
      install-llvm-ranlib and install-llvm-ranlib-stripped. What this means is
      that when installing a distribution that contains both llvm-ar and
      llvm-ranlib is that first the stripped version of llvm-ar is installed
      (by the install-llvm-ar-stripped target) and then it's overwritten by an
      unstripped version of llvm-ar bnecause install-llvm-ranlib-stripped has
      install-llvm-ranlib as a dependency as mentioned earlier. To avoid this
      issue, rather than passing the install-${dest} as dependency, we
      introduce a new argument to add_llvm_install_targets for symlink target
      which expands it into an appropriate dependency, i.e. install-${dest}
      for install-${name} target and install-${dest}-stripped for
      install-${name}-stripped.
      
      Differential Revision: https://reviews.llvm.org/D71951
      71a2a621
    • Bill Wendling's avatar
      Don't rely on 'l'(ell) modifiers to indicate a label reference · 83d690a1
      Bill Wendling authored
      Summary:
      It's not necessary to use an 'l'(ell) modifier when referencing a label.
      Treat block addresses and MBB references as if the modifier is used
      anyway. This prevents us from generating references to ficticious
      labels.
      
      Reviewers: jyknight, nickdesaulniers, hfinkel
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71849
      83d690a1
    • Thomas Preud'homme's avatar
      [FileCheck] Remove FileCheck prefix in API · d8fd92ea
      Thomas Preud'homme authored
      Summary:
      When FileCheck was made a library, types in the public API were renamed
      to add a FileCheck prefix, such as Pattern to FileCheckPattern. Many
      types were moved into a private interface and thus don't need this
      prefix anymore. This commit removes those unneeded prefixes.
      
      Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnk
      
      Reviewed By: jhenderson
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72186
      d8fd92ea
    • Jinsong Ji's avatar
      [PowerPC][NFC] Rename record instructions to use _rec suffix instead of o · 24ee4ede
      Jinsong Ji authored
      We use o suffix to indicate record form instuctions,
      (as it is similar to dot '.' in mne?)
      
      This was fine before, as we did not support XO-form.
      However, with https://reviews.llvm.org/D66902,
      we now have XO-form support.
      
      It becomes confusing now to still use 'o' for record form,
      and it is weird to have something like 'Oo' .
      
      This patch rename all 'o' instructions to use '_rec' instead.
      Also rename `isDot` to `isRecordForm`.
      
      Reviewed By: #powerpc, hfinkel, nemanjai, steven.zhang, lkail
      
      Differential Revision: https://reviews.llvm.org/D70758
      24ee4ede
    • Tyker's avatar
      [Diagnostic] make Wmisleading-indendation not warn about labels · f5329bfc
      Tyker authored
      Reviewers: aaron.ballman, xbolva00
      
      Reviewed By: aaron.ballman
      
      Subscribers: nickdesaulniers, nathanchance
      
      Differential Revision: https://reviews.llvm.org/D72202
      f5329bfc
    • Matt Arsenault's avatar
      GlobalISel: Fix unsupported legalize action · ee6b8722
      Matt Arsenault authored
      This would complain about invalid legalizer rules otherwise.
      
      Mark some operations as unsupported for AMDGPU. This currently seems
      to produce the same legalize error as when no rules are defined, but
      eventually this should produce a proper user facing error.
      ee6b8722
    • Matt Arsenault's avatar
      GlobalISel: Correct result type for G_FCMP in lowerFPTOUI · 1060b9e2
      Matt Arsenault authored
      Using the final result type doesn't make any sense. Use the natural
      default boolean type for the select condition.
      1060b9e2
    • Matt Arsenault's avatar
    • Matt Arsenault's avatar
      AMDGPU: Fix legalizing f16 fpow · 7f2db291
      Matt Arsenault authored
      The existing test only covered one case for r600. The use of
      mul_legacy also looks suspicious to me, but leave it for now. The
      patterns are also not making use of source modifiers.
      7f2db291
    • Matt Arsenault's avatar
      AMDGPU: Use ImmLeaf · a506efff
      Matt Arsenault authored
      This solves one GlobalISel importer error, but the pattern still fails
      for another reason.
      a506efff
    • Matt Arsenault's avatar
      14d25052
    • Matt Arsenault's avatar
      llc/MIR: Fix setFunctionAttributes for MIR functions · 5518a02a
      Matt Arsenault authored
      A random set of attributes are implemented by llc/opt forcing the
      string attributes on the IR functions before processing anything. This
      would not happen for MIR functions, which have not yet been created at
      this point.
      
      Use a callback in the MIR parser, purely to avoid dealing with the
      ugliness that the command line flags are in a .inc file, and would
      require allowing access to these flags from multiple places (either
      from the MIR parser directly, or a new utility pass to implement these
      flags). It would probably be better to cleanup the flag handling into
      a separate library.
      
      This is in preparation for treating more command line flags with a
      corresponding function attribute in a more uniform way. The fast math
      flags in particular have a messy system where the command line flag
      sets the behavior from a function attribute if present, and otherwise
      the command line flag. This means if any other pass tries to inspect
      the function attributes directly, it will be inconsistent with the
      intended behavior. This is also inconsistent with the current behavior
      of -mcpu and -mattr, which overwrites any pre-existing function
      attributes. I would like to move this to consistenly have the command
      line flags not overwrite any pre-existing attributes, and to always
      ensure the command line flags are consistent with the function
      attributes.
      5518a02a
    • Craig Topper's avatar
      [X86] Improve v4i32->v4f64 uint_to_fp for AVX1/AVX2 targets. · 6a0564ad
      Craig Topper authored
      Use zext+or+fsub to do the conversion. Similar to D71971.
      
      Differential Revision: https://reviews.llvm.org/D71971
      6a0564ad
    • Jonas Devlieghere's avatar
      [lldb/Docs] Describe optional dependencies on build page. · 317cbdad
      Jonas Devlieghere authored
      List the different CMake flags controlling the optional dependencies as
      per the discussion on the mailing list:
      
      http://lists.llvm.org/pipermail/lldb-dev/2020-January/015867.html
      317cbdad
    • Craig Topper's avatar
      [LegalizeTypes] Add widening support for STRICT_FSETCC/FSETCCS · 62f3403b
      Craig Topper authored
      This patch adds widening which really just scalarizes because we don't have a strategy for the extra elements we would need to pad with.
      
      Differential Revision: https://reviews.llvm.org/D72193
      62f3403b
    • Craig Topper's avatar
      [X86] Rename vec-strict-*-cmp.ll to vec-strict-cmp-*.ll to match other strict... · ca868002
      Craig Topper authored
      [X86] Rename vec-strict-*-cmp.ll to vec-strict-cmp-*.ll to match other strict files wich have the size at the end. NFC
      ca868002
    • Alexey Bataev's avatar
      [OPENMP50]Support lastprivate conditional updates in inc/dec unary ops. · 7b518dcb
      Alexey Bataev authored
      Added support for checking of updates of variables used in unary
      pre(pos) inc/dec expressions.
      7b518dcb
    • stevewan's avatar
      [NFC] Test commit, revert whitespace change · 02f694b6
      stevewan authored
      As per the Developer Policy, upon obtaining commit access.
      02f694b6
    • stevewan's avatar
      [NFC] Test commit, whitespace change · b73fea6a
      stevewan authored
      As per the Developer Policy, upon obtaining commit access.
      b73fea6a
    • Sanjay Patel's avatar
      22cec48d
    • Kelvin Li's avatar
      [OpenMP] Fix incorrect property of __has_attribute() macro · 19433b19
      Kelvin Li authored
      __has_attribute(fallthough) -> __has_attribute(fallthrough)
      
      Submitted by: kiszk (Kazuaki Ishizaki <ishizaki@jp.ibm.com>)
      
      Differential Revision: https://reviews.llvm.org/D72287
      19433b19
    • Evgenii Stepanov's avatar
      Lower TAGPstack with negative offset to SUBG. · 40a80a0a
      Evgenii Stepanov authored
      Summary:
      This never really occurs in the current codegen, so only a MIR test is
      possible.
      
      Reviewers: ostannard, pcc
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72123
      40a80a0a
    • Amara Emerson's avatar
    • Jinsong Ji's avatar
      [PowerPC][LoopVectorize] Extend getRegisterClassForType to consider double and... · e29a2e6b
      Jinsong Ji authored
      [PowerPC][LoopVectorize] Extend getRegisterClassForType to consider double and other floating point type
      
      In https://reviews.llvm.org/D67148, we use isFloatTy to test floating
      point type, otherwise we return GPRRC.
      So 'double' will be classified as GPRRC, which is not accurate.
      
      This patch covers other floating point types.
      
      Reviewed By: #powerpc, nemanjai
      
      Differential Revision: https://reviews.llvm.org/D71946
      e29a2e6b
    • Kazuaki Ishizaki's avatar
      [lld] Fix trivial typos in comments · 7ae3d335
      Kazuaki Ishizaki authored
      Reviewed By: ruiu, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D72196
      7ae3d335
    • Siva Chandra Reddy's avatar
      [libc] Move all tests to a top level `test` directory. · 5b24c088
      Siva Chandra Reddy authored
      A toplevel target, `check-libc` has also been added.
      
      Reviewers: abrachet, phosek
      
      Tags: #libc-project
      
      Differential Revision: https://reviews.llvm.org/D72177
      5b24c088
    • Jonas Devlieghere's avatar
      [lldb/Docs] Fix capitalization typo. · 0239526c
      Jonas Devlieghere authored
      This has been bothering me for way too long.
      0239526c
    • Jonas Devlieghere's avatar
      [lldb/CMake] Only set PYTHON_HOME on Windows · 8c8ffd46
      Jonas Devlieghere authored
      My earlier change for Python auto-detection caused PYTHON_HOME to be set
      unconditionally, while before the change this only happened for Windows.
      This caused the PythonDataObjectsTest to fail with an import error.
      8c8ffd46
    • Fangrui Song's avatar
      [CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix · bbfebd7b
      Fangrui Song authored
      Summary:
      lib/python2.7/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
      which depends on lib/libLLVM*.so (-DBUILD_SHARED_LIBS=ON) or lib/libLLVM-10git.so
      (-DLLVM_LINK_LLVM_DYLIB=ON). Add an additional rpath `$ORIGIN/../../../../lib` so
      that _lldb.so can be loaded from Python.
      
      This fixes an import error from lib/python2.7/dist-packages/lldb/__init__.py
      
        from . import _lldb
        ImportError: libLLVMAArch64CodeGen.so.10git: cannot open shared object file: No such file or directory
      
       The following configurations will work:
      
      * -DBUILD_SHARED_LIBS=ON
      * -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON
      * -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON
        (-DCLANG_LINK_CLANG_DYLIB=ON depends on -DLLVM_LINK_LLVM_DYLIB=ON)
      
      Reviewed By: labath
      
      Differential Revision: https://reviews.llvm.org/D71800
      bbfebd7b
    • Nico Weber's avatar
      Make check-llvm run 50% faster on macOS, 18% faster on Windows. · f6544934
      Nico Weber authored
      While looking at cycle time graphs of some of my bots, I noticed
      that 32789485 made check-llvm noticeably slower on macOS and
      Windows.
      
      As it turns out, the 5 substitutions added in that change were
      enough to cause lit to thrash the build-in cache in re.compile()
      (re.sub() is implemented as re.compile().sub()), and apparently
      applySubstitutions() is on the cricital path and slow when all
      regexes need to compile all the time.
      
      (See `_MAXCACHE = 512` in cpython/Lib/re.py)
      
      Supporting full regexes for lit substitutions seems a bit like
      overkill, but for now add a simple unbounded cache to recover
      the lost performance.
      
      No intended behavior change.
      f6544934
    • Jonas Devlieghere's avatar
      [lldb/Test] Move @skipIfAsan from test class to test methods. · 3abc2927
      Jonas Devlieghere authored
      skipTestIfFn can only be used to decorate a test method.
      3abc2927
    • Fangrui Song's avatar
      [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal · 896b84ac
      Fangrui Song authored
      This matches GNU readelf and llvm-readobj.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D72234
      896b84ac
    • LLVM GN Syncbot's avatar
      [gn build] Port 350da402 · ba4ca37b
      LLVM GN Syncbot authored
      ba4ca37b