1. Jan 07, 2020
    • 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
    • Tamás Zolnai's avatar
      [clang-tidy] new check: bugprone-signed-char-misuse · 350da402
      Tamás Zolnai authored
      Summary:
      This check searches for signed char -> integer conversions which might
      indicate programming error, because of the misinterpretation of char
      values. A signed char might store the non-ASCII characters as negative
      values. The human programmer probably expects that after an integer
      conversion the converted value matches with the character code
      (a value from [0..255]), however, the actual value is in
      [-128..127] interval.
      
      See also:
      STR34-C. Cast characters to unsigned char before converting to larger integer sizes
      <https://wiki.sei.cmu.edu/confluence/display/c/STR34-C.+Cast+characters+to+unsigned+char+before+converting+to+larger+integer+sizes>
      
      By now this check is limited to assignment / variable declarations.
      If we would catch all signed char -> integer conversion, then it would
      produce a lot of findings and also false positives. So I added only
      this use case now, but this check can be extended with additional
      use cases later.
      The CERT documentation mentions another use case when the char is
      used for array subscript. Next to that a third use case can be
      the signed char - unsigned char comparison, which also a use case
      where things happen unexpectedly because of conversion to integer.
      
      Reviewers: alexfh, hokein, aaron.ballman
      
      Reviewed By: aaron.ballman
      
      Subscribers: sylvestre.ledru, whisperity, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits
      
      Tags: #clang, #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D71174
      350da402
    • Jonas Devlieghere's avatar
      [lldb/Test] Temporarily skip TestFoundationDisassembly on the ASan bot. · 8eba3fbb
      Jonas Devlieghere authored
      This test is timing out on the sanitized bot on GreenDragon. Temporarily
      disable it to increase the signal-to-noise ration.
      8eba3fbb
    • Jonas Devlieghere's avatar
      [lldb/CMake] Autodetect Python dependency · b3757f30
      Jonas Devlieghere authored
      Python was the last remaining "optional" dependency for LLDB. This moves
      the code to find Python into FindPythonInterpAndLibs using the same
      principles as FindCursesAndPanel.
      
      Differential revision: https://reviews.llvm.org/D72107
      b3757f30
    • diggerlin's avatar
      [AIX] Use csect reference for function address constants · 83ec9b51
      diggerlin authored
      SUMMARY:
      We currently emit a reference for function address constants as labels;
      for example:
      
      foo_ptr:
      .long foo
      however, there may be no such label in the case where the function is
      undefined. Although the label exists when the function is defined, we
      will (to be consistent) also use a csect reference in that case.
      
      Address one comment
      https://reviews.llvm.org/D71144#inline-653255
      
      Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
      Subscribers: cebowleratibm, wuzish, nemanjai
      
      Differential Revision: https://reviews.llvm.org/D71144
      83ec9b51
    • Guillaume Chatelet's avatar
      [llvm-libc] Fix missing virtual destructor · 3e1f3b16
      Guillaume Chatelet authored
      Summary: This patch adds a virtual destructor to the Command class.
      
      Reviewers: sivachandra
      
      Subscribers: mgorny, MaskRay, libc-commits
      
      Tags: #libc-project
      
      Differential Revision: https://reviews.llvm.org/D72253
      3e1f3b16
    • David Green's avatar
      [ARM] Use the correct opcodes for Thumb2 segmented stack frame lowering · f88d5272
      David Green authored
      The segmented stack lowering code appears to be using ARM opcodes under
      Thumb2. The MRC opcode will be the same for Thumb and ARM, but t2LDR
      seems wrong. Either way, using the correct thumb vs arm opcodes is more
      correct.
      
      Differential Revision: https://reviews.llvm.org/D72074
      f88d5272
    • David Green's avatar
      [ARM] Use correct TRAP opcode for thumb in FastISel · 0eb981b8
      David Green authored
      We were previously unconditionally using the ARM::TRAP opcode, even
      under Thumb. My understanding is that these are essentially the same
      thing (they both result in a trap under Thumb), but the ARM::TRAP opcode
      is marked as requiring IsARM, so it is more correct to use ARM::tTRAP.
      
      Differential Revision: https://reviews.llvm.org/D72075
      0eb981b8
    • diggerlin's avatar
      [AIX] Use csect reference for function address constants · 61b5e727
      diggerlin authored
      SUMMARY:
      We currently emit a reference for function address constants as labels;
      for example:
      
      foo_ptr:
      .long foo
      however, there may be no such label in the case where the function is
      undefined. Although the label exists when the function is defined, we
      will (to be consistent) also use a csect reference in that case.
      
      Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L
      Subscribers: cebowleratibm, wuzish, nemanjai
      
      Differential Revision: https://reviews.llvm.org/D71144
      61b5e727
    • Mark de Wever's avatar
      Adds -Wrange-loop-analysis to -Wall · eec0240f
      Mark de Wever authored
      This makes the range loop warnings part of -Wall.
      
      Fixes PR32823: Warn about accidental coping of data in range based for
      
      Differential Revision: https://reviews.llvm.org/D68912
      
      Recomitted after fixing the warnings it created.
      eec0240f
    • Mark de Wever's avatar
      [NFC] Fixes -Wrange-loop-analysis warnings · 1d549cff
      Mark de Wever authored
      This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
      
      Differential Revision: https://reviews.llvm.org/D72210
      1d549cff
    • Simon Pilgrim's avatar
      [AMDGPU] Fix "use of uninitialized variable" static analyzer warning. NFCI. · ea2c159f
      Simon Pilgrim authored
      Add "unreachable" default case to AMDGPUTargetStreamer::getArchNameFromElfMach
      ea2c159f
    • Simon Pilgrim's avatar
      Fix "use of uninitialized variable" static analyzer warnings. NFCI. · 5bcc7473
      Simon Pilgrim authored
      Add "unreachable" default cases like we do for the other switch()s in X86MCInstLower::Lower
      5bcc7473
    • Simon Pilgrim's avatar
    • Simon Tatham's avatar
      [ARM,MVE] Fix many signedness errors in MVE intrinsics. · 34817e04
      Simon Tatham authored
      Summary:
      Running an end-to-end test last week I noticed that a lot of the ACLE
      intrinsics that operate differently on vectors of signed and unsigned
      integers were ending up generating the signed version of the
      instruction unconditionally. This is because the IR intrinsics had no
      way to distinguish signed from unsigned: the LLVM type system just
      calls them both `v8i16` (or whatever), so you need either separate
      intrinsics for signed and unsigned, or a flag parameter that tells
      ISel which one to choose.
      
      This patch fixes all the problems of that kind that I've noticed, by
      adding an i32 flag parameter to many of the IR intrinsics which is set
      to 1 for unsigned (matching the existing practice in cases where we
      got it right), and conditioning all the isel patterns on that flag. So
      the fundamental change is in `IntrinsicsARM.td`, changing the
      low-level IR intrinsics API; there are knock-on changes in
      `arm_mve.td` (adjusting code gen for the ACLE intrinsics to use the
      modified API) and in `ARMInstrMVE.td` (adjusting isel to expect the
      new unsigned flags). The rest of this patch is boringly updating tests.
      
      Reviewers: dmgreen, miyuki, MarkMurrayARM
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D72270
      34817e04
    • Simon Tatham's avatar
      [ARM,MVE] Support -ve offsets in gather-load intrinsics. · 4978296c
      Simon Tatham authored
      Summary:
      The ACLE intrinsics with `gather_base` or `scatter_base` in the name
      are wrappers on the MVE load/store instructions that take a vector of
      base addresses and an immediate offset. The immediate offset can be up
      to 127 times the alignment unit, and it can be positive or negative.
      
      At the MC layer, we got that right. But in the Sema error checking for
      the wrapping intrinsics, the offset was erroneously constrained to be
      positive.
      
      To fix this I've adjusted the `imm_mem7bit` class in the Tablegen that
      defines the intrinsics. But that causes integer literals like
      `0xfffffffffffffe04` to appear in the autogenerated calls to
      `SemaBuiltinConstantArgRange`, which provokes a compiler warning
      because that's out of the non-overflowing range of an `int64_t`. So
      I've also tweaked `MveEmitter` to emit that as `-0x1fc` instead.
      
      Updated the tests of the Sema checks themselves, and also adjusted a
      random sample of the CodeGen tests to actually use negative offsets
      and prove they get all the way through code generation without causing
      a crash.
      
      Reviewers: dmgreen, miyuki, MarkMurrayARM
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D72268
      4978296c
    • Simon Tatham's avatar
      [ARM,MVE] Generate the right instruction for vmaxnmq_m_f16. · b99ef32d
      Simon Tatham authored
      Summary:
      Due to a copy-paste error in the isel patterns, the predicated version
      of this intrinsic was expanding to the `VMAXNMT.F32` instruction
      instead of `VMAXNMT.F16`. Similarly for vminnm.
      
      Reviewers: dmgreen, miyuki, MarkMurrayARM
      
      Reviewed By: dmgreen
      
      Subscribers: kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72269
      b99ef32d
    • Matt Arsenault's avatar
      e4464bf3
    • Michał Górny's avatar
      [lldb] [Process/NetBSD] Remove unused orig_*ax use · bc763c42
      Michał Górny authored
      orig_*ax logic is Linux-specific, and was never used on NetBSD.
      In fact, its support seems to be a dead code entirely.
      
      Differential Revision: https://reviews.llvm.org/D72195
      bc763c42
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select more G_EXTRACTs correctly · f1c85ecd
      Matt Arsenault authored
      This assumed a 32-bit extract size, which would produce invalid copies
      with 64-bit extracts. Handle the easy case. Ideally we would have a
      way to get the proper subreg index for any 32-bit offset, but there
      should probably be a tablegenerated way of getting the subreg index
      for any size and offset.
      f1c85ecd
  2. Jan 06, 2020