and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 30 Sep, 2020 2 commits
    • Sanjay Patel's avatar
      [APFloat] prevent NaN morphing into Inf on conversion (PR43907) · 60a25202
      Sanjay Patel authored
      We shift the significand right on a truncation, but that needs to be made NaN-safe:
      always set at least 1 bit in the significand.
      https://llvm.org/PR43907
      
      See D88238 for the likely follow-up (but needs some plumbing fixes before it can proceed).
      
      Differential Revision: https://reviews.llvm.org/D87835
      
      (cherry picked from commit e34bd1e0)
      60a25202
    • Amara Emerson's avatar
      [GlobalISel] Fix multiply with overflow intrinsics legalization generating invalid MIR. · a3aee267
      Amara Emerson authored
      During lowering of G_UMULO and friends, the previous code moved the builder's
      insertion point to be after the legalizing instruction. When that happened, if
      there happened to be a "G_CONSTANT i32 0" immediately after, the CSEMIRBuilder
      would try to find that constant during the buildConstant(zero) call, and since
      it dominates itself would return the iterator unchanged, even though the def
      of the constant was *after* the current insertion point. This resulted in the
      compare being generated *before* the constant which it was using.
      
      There's no need to modify the insertion point before building the mul-hi or
      constant. Delaying moving the insert point ensures those are built/CSEd before
      the G_ICMP is built.
      
      Fixes PR47679
      
      Differential Revision: https://reviews.llvm.org/D88514
      
      (cherry picked from commit 1d54e75c)
      a3aee267
  2. 29 Sep, 2020 1 commit
  3. 28 Sep, 2020 5 commits
    • Hans Wennborg's avatar
      Fix mysterious failure of SupportTests FileCheckTest.Binop · eb83b551
      Hans Wennborg authored
      The test would fail in no-asserts release builds using MSVC
      for 64-bit Windows:
      
      Unexpected error message:
      TestBuffer:1:1: error: implicit format conflict between 'FOO' (%u) and '18\0' (%x), need an explicit format specifier
      
      Error message(s) not found:
      {implicit format conflict between 'FOO' (%u) and 'BAZ' (%x), need an explicit format specifier}
      
      It seems a string from a previous test case is finding its way
      into the latter one.
      
      This doesn't reproduce on master anymore after 998709b7, so let's
      just hack around it here for the branch.
      eb83b551
    • Robert Widmann's avatar
      [LLVM-C] Turn a ShuffleVector Constant Into a Getter. · 29392497
      Robert Widmann authored
      It is not a good idea to expose raw constants in the LLVM C API. Replace this with an explicit getter.
      
      Differential Revision: https://reviews.llvm.org/D88367
      
      (cherry picked from commit 55f72730)
      29392497
    • Craig Disselkoen's avatar
      C API: functions to get mask of a ShuffleVector · 9e367bd6
      Craig Disselkoen authored
      This commit fixes a regression (from LLVM 10 to LLVM 11 RC3) in the LLVM
      C API.
      
      Previously, commit 1ee6ec2b removed the mask operand from the
      ShuffleVector instruction, storing the mask data separately in the
      instruction instead; this reduced the number of operands of
      ShuffleVector from 3 to 2. AFAICT, this change unintentionally caused
      a regression in the LLVM C API. Specifically, it is no longer possible
      to get the mask of a ShuffleVector instruction through the C API. This
      patch introduces new functions which together allow a C API user to get
      the mask of a ShuffleVector instruction, restoring the functionality
      which was previously available through LLVMGetOperand().
      
      This patch also adds tests for this change to the llvm-c-test
      executable, which involved adding support for InsertElement,
      ExtractElement, and ShuffleVector itself (as well as constant vectors)
      to echo.cpp. Previously, vector operations weren't tested at all in
      echo.ll.
      
      I also fixed some typos in comments and help-text nearby these changes,
      which I happened to spot while developing this patch. Since the typo
      fixes are technically unrelated other than being in the same files, I'm
      happy to take them out if you'd rather they not be included in the patch.
      
      Differential Revision: https://reviews.llvm.org/D88190
      
      (cherry picked from commit 51cad041)
      9e367bd6
    • Simon Atanasyan's avatar
      [CodeGen] Do not call `emitGlobalConstantLargeInt` for constant requires 8 bytes to store · 1e4b179b
      Simon Atanasyan authored
      This is a fix for PR47630. The regression is caused by the D78011. After
      this change the code starts to call the `emitGlobalConstantLargeInt` even
      for constants which requires eight bytes to store.
      
      Differential revision: https://reviews.llvm.org/D88261
      
      (cherry picked from commit c6c5629f)
      1e4b179b
    • Matt Arsenault's avatar
      AArch64/GlobalISel: Narrow stack passed argument access size · 184a13d3
      Matt Arsenault authored
      This fixes a verifier error in the testcase from bug 47619.
      
      The stack passed s3 value was widened to 4-bytes, and producing a
      4-byte memory access with a < 1 byte result type. We need to either
      widen the result type or narrow the access size. This copies the code
      directly from the AMDGPU handling, which narrows the load size. I
      don't like that every target has to handle this, but this is currently
      broken on the 11 release branch and this is the simplest fix.
      
      This reverts commit 42bfa7c6.
      
      (cherry picked from commit 6cb0d23f)
      184a13d3
  4. 25 Sep, 2020 1 commit
  5. 24 Sep, 2020 1 commit
  6. 22 Sep, 2020 6 commits
    • Hans Wennborg's avatar
      0b56e549
    • Hans Wennborg's avatar
      llvm index.rst: Drop in-progress warning · 1b80e741
      Hans Wennborg authored
      1b80e741
    • Jessica Clarke's avatar
      [clang][docs] Fix documentation of -O · 8aca41f3
      Jessica Clarke authored
      D79916 changed the behaviour from -O2 to -O1 but the documentation was
      not updated to reflect this.
      
      (cherry picked from commit 788c7d2e)
      8aca41f3
    • Lucas Prates's avatar
      [CodeGen] Fixing inconsistent ABI mangling of vlaues in SelectionDAGBuilder · b513e196
      Lucas Prates authored
      SelectionDAGBuilder was inconsistently mangling values based on ABI
      Calling Conventions when getting them through copyFromRegs in
      SelectionDAGBuilder, causing duplicate value type convertions for
      function arguments. The checking for the mangling requirement was based
      on the value's originating instruction and was performed outside of, and
      inspite of, the regular Calling Convention Lowering.
      
      The issue could be observed in a scenario such as:
      
      ```
      %arg1 = load half, half* %const, align 2
      %arg2 = call fastcc half @someFunc()
      call fastcc void @otherFunc(half %arg1, half %arg2)
      ; Here, %arg2 was incorrectly mangled twice, as the CallConv data from
      ; the call to @someFunc() was taken into consideration for the check
      ; when getting the value for processing the call to @otherFunc(...),
      ; after the proper convertion had taken place when lowering the return
      ; value of the first call.
      ```
      
      This patch fixes the issue by disregarding the Calling Convention
      information for such copyFromRegs, making sure the ABI mangling is
      properly contanined in the Calling Convention Lowering.
      
      This fixes Bugzilla #47454.
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D87844
      
      (cherry picked from commit 53d238a9)
      b513e196
    • James Y Knight's avatar
      PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly... · 6250d494
      James Y Knight authored
      PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after an INLINEASM_BR.
      
      findPHICopyInsertPoint special cases placement in a block with a
      callbr or invoke in it. In that case, we must ensure that the copy is
      placed before the INLINEASM_BR or call instruction, if the register is
      defined prior to that instruction, because it may jump out of the
      block.
      
      Previously, the code placed it immediately after the last def _or
      use_. This is wrong, if the use is the instruction which may jump.  We
      could correctly place it immediately after the last def (ignoring
      uses), but that is non-optimal for register pressure.
      
      Instead, place the copy after the last def, or before the
      call/inlineasm_br, whichever is later.
      
      Differential Revision: https://reviews.llvm.org/D87865
      
      (cherry picked from commit f7a53d82)
      6250d494
    • David Blaikie's avatar
      [llvm] Add contains(KeyType) -> bool methods to SmallPtrSet · 410b0dc8
      David Blaikie authored
      Matches C++20 API addition.
      
      Differential Revision: https://reviews.llvm.org/D83449
      
      (cherry picked from commit a0385bd7)
      410b0dc8
  7. 17 Sep, 2020 3 commits
  8. 16 Sep, 2020 10 commits
  9. 15 Sep, 2020 11 commits