1. Apr 11, 2020
    • Simon Pilgrim's avatar
    • Dmitry Vyukov's avatar
      tsan: add newline in test file · c65e6079
      Dmitry Vyukov authored
      Buildbots say:
      
      [126/127] Running lint check for sanitizer sources...
      FAILED: projects/compiler-rt/lib/CMakeFiles/SanitizerLintCheck
      cd /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/stage1/projects/compiler-rt/lib && env LLVM_CHECKOUT=/home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/llvm SILENT=1 TMPDIR= PYTHON_EXECUTABLE=/usr/bin/python COMPILER_RT=/home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/compiler-rt /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
      /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:71:  Could not find a newline character at the end of the file.  [whitespace/ending_newline] [5]
      ninja: build stopped: subcommand failed.
      
      Somehow this check is not part of 'ninja check-tsan'.
      c65e6079
    • Simon Pilgrim's avatar
    • Dmitry Vyukov's avatar
      tsan: fix leak of ThreadSignalContext memory mapping when destroying fibers · 1624be93
      Dmitry Vyukov authored
      When creating and destroying fibers in tsan a thread state is created and destroyed. Currently, a memory mapping is leaked with each fiber (in __tsan_destroy_fiber). This causes applications with many short running fibers to crash or hang because of linux vm.max_map_count.
      
      The root of this is that ThreadState holds a pointer to ThreadSignalContext for handling signals. The initialization and destruction of it is tied to platform specific events in tsan_interceptors_posix and missed when destroying a fiber (specifically, SigCtx is used to lazily create the ThreadSignalContext in tsan_interceptors_posix). This patch cleans up the memory by makinh the ThreadState create and destroy the ThreadSignalContext.
      
      The relevant code causing the leak with fibers is the fiber destruction:
      
      void FiberDestroy(ThreadState *thr, uptr pc, ThreadState *fiber) {
        FiberSwitchImpl(thr, fiber);
        ThreadFinish(fiber);
        FiberSwitchImpl(fiber, thr);
        internal_free(fiber);
      }
      
      Author: Florian
      Reviewed-in: https://reviews.llvm.org/D76073
      1624be93
    • Dmitry Vyukov's avatar
      tsan: disable ASLR in Go test on NetBSD · efeb35e1
      Dmitry Vyukov authored
      Tsan does not support ASLR on NetBSD.
      Disable ASLR in the Go test and extend
      the error message to be more actionable.
      
      Reported-by: Keith Randall (khr)
      efeb35e1
    • River Riddle's avatar
      [mlir][NFC] Refactor ClassID into a TypeID class. · a517191a
      River Riddle authored
      Summary: ClassID is a bit janky right now as it involves passing a magic pointer around. This revision hides the internal implementation mechanism within a new class TypeID. This class is a value-typed wrapper around the original ClassID implementation.
      
      Differential Revision: https://reviews.llvm.org/D77768
      a517191a
    • Craig Topper's avatar
      Change FastISel::CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI. · 9c1842d8
      Craig Topper authored
      This is the same as what was done to the CallLoweringInfo in
      TargetLowering.h in r309159.
      
      This is just a step on the way to replacing this with CallBase.
      9c1842d8
    • River Riddle's avatar
      [mlir][Pass] Add a new `Pass::getArgument` hook · 7824768b
      River Riddle authored
      Summary: This hook allows for passes to specify the command line argument without the need for registration. More concretely this will allow for generating pass crash reproducers without needing to have the passes registered. This should remove the need for production tools to register passes, leaving that solely to development tools like mlir-opt.
      
      Differential Revision: https://reviews.llvm.org/D77907
      7824768b
    • Shengchen Kan's avatar
      [NFC][test] Refine tests for branch align · 7ad46cfe
      Shengchen Kan authored
      Remove some redundant blank and triple description. And rename some
      files.
      7ad46cfe
    • Shengchen Kan's avatar
      [X86][MC] Make -x86-pad-max-prefix-size compatible with --mc-relax-all · 5d73f79c
      Shengchen Kan authored
      Summary: We allow non-relaxable instructions emitted into relaxable Fragment when we prefix padding branch. So we need to check if the instruction need relaxation before relaxing it.  Without this patch, it currently triggers a `report_fatal_error` in `llvm::MCAsmBackend::relaxInstruction` when we prefix padding branch along with `--mc-relax-all`.
      
      Reviewers: LuoYuanke, reames, MaskRay
      
      Reviewed By: MaskRay
      
      Subscribers: MaskRay, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77851
      5d73f79c
    • Julian Lettner's avatar
      c610807a
    • Craig Topper's avatar
      [CallSite removal][SelectionDAGBuilder] Remove most CallSite usage from visitInlineAsm. · f49f6cf9
      Craig Topper authored
      I only left it at the interface to ParseConstraints since that
      needs updates to other callers in different files. I'll do that
      as a follow up.
      
      Differential Revision: https://reviews.llvm.org/D77892
      f49f6cf9
    • Nemanja Ivanovic's avatar
      [PowerPC] Another folow-up fix for 6c4b40de · 04eae396
      Nemanja Ivanovic authored
      There was another issue introduced by this commit that the OP
      initially missed. Namely, for functions that are free to use
      R2 as a callee-saved register, we emit a TOC expression based
      on the address of the GEP label without emitting the GEP label.
      Since we only emit such expressions for the large code model, this
      issue only surfaced there.
      
      I have confirmed that with this fix, the kernel build is successful
      with target "all".
      04eae396
    • Scott Constable's avatar
      [X86] Fix to X86LoadValueInjectionRetHardeningPass for possible segfault · 05051810
      Scott Constable authored
      `MBB.back()` could segfault if `MBB.empty()`. Fixed by checking for `MBB.empty()` in the loop.
      
      Differential Revision: https://reviews.llvm.org/D77584
      05051810
    • Jim Ingham's avatar
      Convert the ThreadPlanCommands test to use a scripted plan · aa4b37b2
      Jim Ingham authored
      that pushes a step over plan.  Relax the listing checker
      so it will look past any entries after the ones listed in
      the input patterns.  Then for the internal plans just check
      for the StepOver plan that our scripted plan pushes, and look past
      any others.
      
      This should make the test more robust on systems that don't use the
      step-in then push a step-out plan to step over a function.
      aa4b37b2
    • Jim Ingham's avatar
      Thread Plans pushed by a scripted plan should be private plans. · f7de4b5d
      Jim Ingham authored
      If a plan is not private, "thread plan discard" can discard it.  It would
      not be hard to write reliable scripted plan if its subplans could get
      removed out from under it.
      f7de4b5d
    • Mehdi Amini's avatar
      Revert "[TLI] Per-function fveclib for math library used for vectorization" · ed03d948
      Mehdi Amini authored
      This reverts commit 60c642e7.
      
      This patch is making the TLI "closed" for a predefined set of VecLib
      while at the moment it is extensible for anyone to customize when using
      LLVM as a library.
      Reverting while we figure out a way to re-land it without losing the
      generality of the current API.
      
      Differential Revision: https://reviews.llvm.org/D77925
      ed03d948
    • Siva Chandra Reddy's avatar
      [libc] Add fully-qualified target names. · e4767a6f
      Siva Chandra Reddy authored
      Only targets setup by the special LLVM libc rules now have fully
      qualified names. The naming style is similar to fully qualified names in
      Python.
      
      Reviewers: abrachet, PaulkaToast, phosek
      
      Differential Revision: https://reviews.llvm.org/D77340
      e4767a6f
    • Matt Arsenault's avatar
      GlobalISel: Fix incorrect lowering G_FCOPYSIGN · 49ae0fc2
      Matt Arsenault authored
      In the basic case, this was reading the sign from the wrong operand.
      49ae0fc2
    • Huihui Zhang's avatar
      [GVN] Fix VNCoercion for Scalable Vector. · 6e7eeb44
      Huihui Zhang authored
      Summary:
      For VNCoercion, skip scalable vector when analysis rely on fixed size,
      otherwise call TypeSize::getFixedSize() explicitly.
      
      Add unit tests to check funtionality of GVN load elimination for scalable type.
      
      Reviewers: sdesmalen, efriedma, spatel, fhahn, reames, apazos, ctetreau
      
      Reviewed By: efriedma
      
      Subscribers: bjope, hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76944
      6e7eeb44
    • Julian Lettner's avatar
      [lit] Fix tests on Windows · 15000650
      Julian Lettner authored
      max-time.py:
        Windows does not have a native `sleep` command, use `time.sleep()` in
        Python instead.
      
      max-failures.py:
        The max-failure test reused the shtest-shell test inputs instead of
        defining its own "test domain".  However, the output of this
        shtest-shell "test domain" is slightly different on Windows, which now
        bites us since we made the max-failures test stricter.  Let's define
        our own "max failures" test domain.
      15000650
    • David Blaikie's avatar
      llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries · 416fa772
      David Blaikie authored
      This probably isn't ideal - the error was being printed specifically
      inline with the dumping that was more legible - but then the error
      wasn't reported to stderr and didn't produce a non-zero exit code.
      
      Probably the error message could be improved by adding more context now
      that it isn't printed in-situ of the DIE dumping as much.
      416fa772
    • Eric Christopher's avatar
      Exclude bitcast and ext/trunc signbit optimization on ppc_fp128 · 45dca043
      Eric Christopher authored
      Revision a1c05fe2 <https://reviews.llvm.org/rGa1c05fe20f3def1f1be9f50d2adefc6b6f1578ad>
      removed bitcast from the list of problematic transformations, however:
      
        %97 = fptrunc ppc_fp128 %2 to double            // we need to check ppc_fp128 here to prevent the transformation
        %98 = bitcast double %97 to i64                 // a1c05fe2 checks ppc_fp128 at here
        %99 = icmp slt i64 %98, 0
        %100 = zext i1 %99 to i8
        store i8 %100, i8* %7, align 1
      
      so this patch does that. I'm also disabling it in the presence of extend just in case.
      
      I verified separately that the hash of -std::infinity and std::infinity don't match now.
      
      Differential Revision: https://reviews.llvm.org/D77911
      45dca043
    • Fangrui Song's avatar
      [ELF][test] Reorganize format-binary.test · c81daab7
      Fangrui Song authored
      Also drop dependency on the output directory name (lit implementation detail).
      c81daab7
    • Huihui Zhang's avatar
      [BasicAA] Fix aliasGEP/DecomposeGEPExpression for scalable type. · 6c989d02
      Huihui Zhang authored
      Summary:
      Don't attempt to analyze the decomposed GEP for scalable type.
      GEP index scale is not compile-time constant for scalable type.
      Be conservative, return MayAlias.
      
      Explicitly call TypeSize::getFixedSize() to assert on places where
      scalable type doesn't make sense.
      
      Add unit tests to check functionality of -basicaa for scalable type.
      
      This patch is needed for D76944.
      
      Reviewers: sdesmalen, efriedma, spatel, bjope, ctetreau
      
      Reviewed By: efriedma
      
      Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77828
      6c989d02
    • Jonas Devlieghere's avatar
      [lldb/Test] Rewrite ReproducerInstrumentationTest · f78fcd69
      Jonas Devlieghere authored
      The instrumentation unit tests' current implementation uses global
      variables to track constructor calls for the instrumented classes during
      replay. This is suboptimal because it indirectly relies on how the
      reproducer instrumentation is implemented. I found out when adding
      support for passive replay and the test broke because we made an extra
      (temporary) copy of the instrumented objects.
      
      Additionally, the old approach wasn't very self-explanatory. It took me
      a bit of time to understand why we were expecting the number of objects
      in the test.
      
      This patch rewrites the test and uses the index-to-object-mapping to
      verify the objects created during replay. You can now specify the
      expected objects, in order, and whether they should be valid or not. I
      find that it makes the tests much easier to understand. More
      importantly, this approach is resilient to implementation detail changes
      in the instrumentation.
      f78fcd69
    • Sam Clegg's avatar
      [WebAssembly] Minor cleanup to WebAssemblySubtarget. NFC. · 16206ee0
      Sam Clegg authored
      Pretty much all other platforms pass CPU string as arg0 of
      initializeSubtargetDependencies.
      
      Differential Revision: https://reviews.llvm.org/D77894
      16206ee0
    • Martijn Vels's avatar
      Make basic_string::operator=() tail call properly · 7ba045a4
      Martijn Vels authored
      Summary: We discovered that the compiler may chose not to inline the operator=, which leads to an expensive extra stack frame. This change makes __assign_no_alias always tail called.
      
      Reviewers: EricWF, #libc!
      
      Subscribers: libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D77913
      7ba045a4
    • Daniel Sanders's avatar
      Add -debugify-and-strip-all to add debug info before a pass and remove it after · f71350f0
      Daniel Sanders authored
      Summary:
      This allows us to test each backend pass under the presence
      of debug info using pre-existing tests. The tests should not
      fail as a result of this so long as it's true that debug info
      does not affect CodeGen.
      
      In practice, a few tests are sensitive to this:
      * Tests that check the pass structure (e.g. O0-pipeline.ll)
      * Tests that check --debug output. Specifically instruction
        dumps containing MMO's (e.g. prelegalizercombiner-extends.ll)
      * Tests that contain debugify metadata as mir-strip-debug will
        remove it (e.g. fastisel-debugvalue-undef.ll)
      * Tests with partial debug info (e.g.
        patchable-function-entry-empty.mir had debug info but no
        !llvm.dbg.cu)
      * Tests that check optimization remarks overly strictly (e.g.
        prologue-epilogue-remarks.mir)
      * Tests that would inject the pass in an unsafe region (e.g.
        seqpairspill.mir would inject between register alloc and
        virt reg rewriter)
      In all cases, the checks can either be updated or
      --debugify-and-strip-all-safe=0 can be used to avoid being
      affected by something like llvm-lit -Dllc='llc --debugify-and-strip-all-safe'
      
      I tested this without the lost debug locations verifier to
      confirm that AArch64 behaviour is unaffected (with the fixes
      in this patch) and with it to confirm it finds the problems
      without the additional RUN lines we had before.
      
      Depends on D77886, D77887, D77747
      
      Reviewers: aprantl, vsk, bogner
      
      Subscribers: qcolombet, kristof.beyls, hiraditya, danielkiss, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77888
      f71350f0
    • Julian Lettner's avatar
      [lit] Increase sleep time in timeout test · 5925c4a0
      Julian Lettner authored
      Fixup for cbe42a9d.  Increase values for testing the overall lit
      timeout (--max-time) which wasn't enough for the test to complete on
      very slow build bots.
      5925c4a0
    • Lang Hames's avatar
    • Matt Arsenault's avatar
      Disable test on windows · 1e93b3d8
      Matt Arsenault authored
      1e93b3d8
    • Mircea Trofin's avatar
      [llvm][NFC] Inliner.cpp: ensure InlineHistory ID is always initialized; · da9bcdaa
      Mircea Trofin authored
      Summary:
      The inline history is associated with a call site. There are two locations
      we fetch inline history. In one, we fetch it together with the call
      site. In the other, we initialize it under certain conditions, use it
      later under same conditions (different if check), and otherwise is
      uninitialized. Although currently there is no uninitialized use, the
      code is more challenging to maintain correctly, than if the value were
      always initialized.
      
      Changed to the upfront initialization pattern already present in this
      file.
      
      Reviewers: davidxl, dblaikie
      
      Subscribers: eraman, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77877
      da9bcdaa
    • Daniel Sanders's avatar
      [mir-strip-debug] Optionally preserve debug info that wasn't from debugify/mir-debugify · dfca98d6
      Daniel Sanders authored
      Summary:
      A few tests start out with debug info and expect it to reach
      the output. For these tests we shouldn't strip the debug info
      
      Reviewers: aprantl, vsk, bogner
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77886
      dfca98d6
    • Julian Lettner's avatar
      [lit] Add SKIPPED test result category · cbe42a9d
      Julian Lettner authored
      Track and print the number of skipped tests.  Skipped tests are tests
      that should have been executed but weren't due to:
        * user interrupt [Ctrl+C]
        * --max-time (overall lit timeout)
        * --max-failures
      
      This is part of a larger effort to ensure that all discovered tests are
      properly accounted for.
      
      Add test for overall lit timeout feature (`--max-time` option) to
      observe skipped tests.  Extend test for `--max-failures` option.
      
      Reviewed By: jdenny
      
      Differential Revision: https://reviews.llvm.org/D77819
      cbe42a9d
    • Christopher Tetreault's avatar
      Clean up usages of asserting vector getters in Type · 889f6606
      Christopher Tetreault authored
      Summary:
      Remove usages of asserting vector getters in Type in preparation for the
      VectorType refactor. The existence of these functions complicates the
      refactor while adding little value.
      
      Reviewers: stoklund, sdesmalen, efriedma
      
      Reviewed By: sdesmalen
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77272
      889f6606
    • River Riddle's avatar
      [mlir][Pass] Allow duplicate pass registration. · 33f76e23
      River Riddle authored
      Summary: With users registering their own dependencies, duplicate pass registration becomes more and more common. This revision relaxes that pass registration be unique. This is safe to assume given that we key on the passID, which is guaranteed to be unique per pass class.
      
      Differential Revision: https://reviews.llvm.org/D77909
      33f76e23
    • Louis Dionne's avatar
      [libc++] NFC: Clean up a lot of old Lit features · 7149bb70
      Louis Dionne authored
      The libc++ test suite has a lot of old Lit features used to XFAIL tests
      and mark them as UNSUPPORTED. Many of them are to workaround problems on
      old compilers or old platforms. As time goes by, it is good to go and
      clean those up to simplify the configuration of the test suite, and also
      to reflect the testing reality. It's not useful to have markup that gives
      the impression that e.g. clang-3.3 is supported, when we don't really
      test on it anymore (and hence several new tests probably don't have the
      necessary markup on them).
      7149bb70
    • Christopher Tetreault's avatar
      Clean up usages of asserting vector getters in Type · 40ed21bb
      Christopher Tetreault authored
      Summary:
      Remove usages of asserting vector getters in Type in preparation for the
      VectorType refactor. The existence of these functions complicates the
      refactor while adding little value.
      
      Reviewers: dexonsmith, sdesmalen, efriedma
      
      Reviewed By: efriedma
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77276
      40ed21bb
    • River Riddle's avatar
      [mlir][ODS] Add support for optional operands and results with a new Optional directive. · aba1acc8
      River Riddle authored
      Summary: This revision adds support for specifying operands or results as "optional". This is a special case of variadic where the number of elements is either 0 or 1. Operands and results of this kind will have accessors generated using Value instead of the range types, making it more natural to interface with.
      
      Differential Revision: https://reviews.llvm.org/D77863
      aba1acc8