1. Dec 06, 2021
  2. Dec 05, 2021
    • Sanjay Patel's avatar
      [InstSimplify] fix logic fold of 'or' for vectors · c65e651e
      Sanjay Patel authored
      Reduce code duplication for commutative pattern matching
      and fix a miscompile.
      
      We can't safely propagate an undef element in this transform:
      https://alive2.llvm.org/ce/z/s5xy55
      c65e651e
    • Sanjay Patel's avatar
      [InstSimplify] add/adjust tests for 'or' logic fold; NFC · 0bb8a97b
      Sanjay Patel authored
      The last test shows a miscompile:
      https://alive2.llvm.org/ce/z/s5xy55
      0bb8a97b
    • Sanjay Patel's avatar
      dccddb26
    • Kristina Bessonova's avatar
    • Nilay Vaish's avatar
      Remove duplicate comment · 3536e18a
      Nilay Vaish authored
      The same comment appears in the very next line.
      
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D115018
      3536e18a
    • Nico Weber's avatar
      dfb68e49
    • Mark de Wever's avatar
      Microsoft's floating-point to_chars powered by Ryu and Ryu Printf · a8025e06
      Mark de Wever authored
      Microsoft would like to contribute its implementation of floating-point to_chars to libc++. This uses the impossibly fast Ryu and Ryu Printf algorithms invented by Ulf Adams at Google. Upstream repos: https://github.com/microsoft/STL and https://github.com/ulfjack/ryu .
      
      Licensing notes: MSVC's STL is available under the Apache License v2.0 with LLVM Exception, intentionally chosen to match libc++. We've used Ryu under the Boost Software License.
      
      This patch contains minor changes from Jorg Brown at Google, to adapt the code to libc++. He verified that it works in Google's Linux-based environment, but then I applied more changes on top of his, so any compiler errors are my fault. (I haven't tried to build and test libc++ yet.) Please tell me if we need to do anything else in order to follow https://llvm.org/docs/DeveloperPolicy.html#attribution-of-changes .
      
      Notes:
      
      * libc++'s integer charconv is unchanged (except for a small refactoring). MSVC's integer charconv hasn't been tuned for performance yet, so you're not missing anything.
      * Floating-point from_chars isn't part of this patch because Jorg found that MSVC's implementation (derived from our CRT's strtod) was slower than Abseil's. If you're unable to use Abseil or another implementation due to licensing or technical considerations, Microsoft would be delighted if you used MSVC's from_chars (and you can just take it, or ask us to provide a patch like this). Ulf is also working on a novel algorithm for from_chars.
      * This assumes that float is IEEE 32-bit, double is IEEE 64-bit, and long double is also IEEE 64-bit.
      * I have added MSVC's charconv tests (the whole thing: integer/floating from_chars/to_chars), but haven't adapted them to libcxx's harness at all. (These tests will be available in the microsoft/STL repo soon.)
      * Jorg added int128 codepaths. These were originally present in upstream Ryu, and I removed them from microsoft/STL purely for performance reasons (MSVC doesn't support int128; Clang on Windows does, but I found that x64 intrinsics were slightly faster).
      * The implementation is split into 3 headers. In MSVC's STL, charconv contains only Microsoft-written code. xcharconv_ryu.h contains code derived from Ryu (with significant modifications and additions). xcharconv_ryu_tables.h contains Ryu's large lookup tables (they were sufficiently large to make editing inconvenient, hence the separate file). The xmeow.h convention is MSVC's for internal headers; you may wish to rename them.
      * You should consider separately compiling the lookup tables (see https://github.com/microsoft/STL/issues/172 ) for compiler throughput and reduced object file size.
      * See https://github.com/StephanTLavavej/llvm-project/commits/charconv for fine-grained history. (If necessary, I can perform some rebase surgery to show you what Jorg changed relative to the microsoft/STL repo; currently that's all fused into the first commit.)
      
      Differential Revision: https://reviews.llvm.org/D70631
      a8025e06
    • Mark de Wever's avatar
      [libc++][ci] Disable generating debug information. · 15495be0
      Mark de Wever authored
      In the bootstrap build generating debug information causes an ICE.
      This is a work-around for llvm.org/PR52584
      15495be0
    • Florian Hahn's avatar
      [VPlan] Separate ctors for VPWidenIntOrFpInduction. (NFC) · 7c3c352d
      Florian Hahn authored
      VPWidenIntOrFpInductionRecipes can either be constructed with a PHI and
      an optional cast or a PHI and a trunc instruction. Reflect this in 2
      separate constructors. This also simplifies a follow-up change.
      7c3c352d
    • Kristina Bessonova's avatar
      Reland [DwarfDebug] Support emitting function-local declaration for a lexical block · 75b622a7
      Kristina Bessonova authored
      This is another attempt to make function-local declarations
      (like static variables, structs/classes and other) be correctly
      emitted within a lexical (bracketed) block.
      
      Fixes https://bugs.llvm.org/show_bug.cgi?id=19238.
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D113741
      75b622a7
    • Kristina Bessonova's avatar
      Reland [DwarfDebug] Move emission of global vars, types and imports to endModule() · 0ac75e82
      Kristina Bessonova authored
      This patch proposes to move emission of global variables, types,
      imported entities, etc from DwarfDebug::beginModule() to DwarfDebug::endModule().
      Effectively, this changes nothing but the order of debug entities which
      will be as follows:
      * subprograms (including related context, local variables/labels,
        local imported entities; related types can be created as a part of
        the emission of local entities of an abstract subprogram);
      * global variables (including related context and types);
      * retained types and enums;
      * non-local-scoped imported entities;
      * basic types;
      * other types left (as a part of local variables attributes emission).
      
      Note that the order of emitted compile units may also be changed as now we emit
      units that contain subprograms first and then all other non-empty units.
      
      The motivation behind this change is the following:
      (1) DwarfDebug::beginModule() is run at the very beginning of backend's pipeline,
          from this time IR can be significantly changed by target-specific passes.
          If it happens for debug metadata of global entities, those changes will not
          be reflected in the emitted DWARF.
      (2) imported subprogram names should refer to an abstract subprogram if it exists,
          but it isn't known in DwarfDebug::beginModule() (it's possible to make some
          guesses based on location info, but it's not quite reliable);
      (3) aforementioned entities if they are scoped within a bracketed block
          (subject of D113741) couldn't be emitted in DwarfDebug::beginModule()
          (they need parent emitted first). Another problem is if to try to gather
          some information about local entities and defer their emission
          (till subprogram's processing or DwarfDebug::endModule()) all the gathered
          details might be irrelevant / invalid by the time the entities are being
          emitted (because of (1)).
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D114705
      0ac75e82
    • Phoebe Wang's avatar
      [X86][FP16] Replace vXi16 to vXf16 instead of v8f16 · f37d9b41
      Phoebe Wang authored
      Fixes pr52561
      
      Reviewed By: LuoYuanke
      
      Differential Revision: https://reviews.llvm.org/D114304
      f37d9b41
    • Florian Hahn's avatar
      [MemoryLocation] Use getForArgument in getForSource/getForDest. (NFC) · 203f29b4
      Florian Hahn authored
      getForArgument already knows how to extract a memory location for all
      memory intrinsics. Use it instead of duplicating the logic.
      203f29b4
    • Lang Hames's avatar
      [JITLink][ELF][x86-64] Adjust addends for R_X86_64_PLT32 relocations. · 21562c03
      Lang Hames authored
      R_X86_64_PLT32 explicitly represents the '-4' PC-adjustment in the relocation's
      addend, but JITLink's x86_64::Branch32PCRel includes the PC-adjustment
      implicitly. We have been zeroing the addend to account for the difference, but
      this breaks for branches to non-zero offsets past labels. This patch updates the
      relocation parsing code to unconditionally adjust the offset by '+4' instead.
      For branches directly to labels the result is still 0, for branches to offsets
      past labels the result is the correct addend for x86_64::Branch32PCRel.
      21562c03
    • David Green's avatar
      [DAG] Create fptoui.sat from clamped fptosi · 57ff805a
      David Green authored
      As an extension to D111976, this converts clamp fptosi, clamped between
      0 and (2^n)-1 to a fptoui.sat. This can greatly help on targets with
      conversions that naturally saturate, such as Arm.
      
      X86 disables the transform as some of the test cases increases in size.
      A fptoui.sat necessitates a fp clamp without native support, so there is
      little use in converting if the instruction is just going to be
      expanded.
      
      Differential Revision: https://reviews.llvm.org/D112428
      57ff805a
    • Lang Hames's avatar
      [JITLink][ELF][x86-64] Use the right edge-naming function for debugging output. · c22b1106
      Lang Hames authored
      Graph edges use the generic x86-64 edge set (the ELF specific edges are only
      used during parsing).
      c22b1106