1. Nov 18, 2021
    • Vitaly Buka's avatar
      [sanitizer] Add a few of type_traits tools · a82ee2be
      Vitaly Buka authored
      For D114047
      a82ee2be
    • Rob Suderman's avatar
      [mlir][tosa] Fixed shape inference for tosa.transpose_conv2d · 044e7e01
      Rob Suderman authored
      Transpose conv2d shape inference was incorrect, tests did not properly validate
      that the shape inference was executing. Corrected shape inference, and extended
      tests to actually execute.
      
      Reviewed By: NatashaKnk
      
      Differential Revision: https://reviews.llvm.org/D114026
      044e7e01
    • James Farrell's avatar
      Add Android test case for -Wpartial-availability. Also update Android... · a340a491
      James Farrell authored
      Add Android test case for -Wpartial-availability. Also update Android availability tests to match on the whole string, so we can distinguish between "Android 16" and "Android 16.0.0" at the end of warning messages.
      
      Reviewed By: danalbert, srhines
      
      Differential Revision: https://reviews.llvm.org/D114036
      a340a491
    • Peyton, Jonathan L's avatar
      [OpenMP][libomp] Enable HWLOC topology detection of multiple CPU kinds · a733b18b
      Peyton, Jonathan L authored
      Teach the HWLOC topology method how to detect Atom and Core
      types so hybrid CPUs are properly detected and represented when using
      the HWLOC topology method.
      
      Differential Revision: https://reviews.llvm.org/D112270
      a733b18b
    • River Riddle's avatar
      [mlir] Refactor AbstractOperation and OperationName · edc6c0ec
      River Riddle authored
      The current implementation is quite clunky; OperationName stores either an Identifier
      or an AbstractOperation that corresponds to an operation. This has several problems:
      
      * OperationNames created before and after an operation are registered are different
      * Accessing the identifier name/dialect/etc. from an OperationName are overly branchy
        - they need to dyn_cast a PointerUnion to check the state
      
      This commit refactors this such that we create a single information struct for every
      operation name, even operations that aren't registered yet. When an OperationName is
      created for an unregistered operation, we only populate the name field. When the
      operation is registered, we populate the remaining fields. With this we now have two
      new classes: OperationName and RegisteredOperationName. These both point to the
      same underlying operation information struct, but only RegisteredOperationName can
      assume that the operation is actually registered. This leads to a much cleaner API, and
      we can also move some AbstractOperation functionality directly to OperationName.
      
      Differential Revision: https://reviews.llvm.org/D114049
      edc6c0ec
    • Peyton, Jonathan L's avatar
      [OpenMP][libomp] Improve Windows Processor Group handling within topology · 286094af
      Peyton, Jonathan L authored
      The current implementation of Windows Processor Groups has
      a separate topology method to handle them. This patch deprecates
      that specific method and uses the regular CPUID topology
      method by default and inserts the Windows Processor Group objects
      in the topology manually.
      
      Notes:
      * The preference for processor groups is lowered to a value less than
        socket so that the user will see sockets in the KMP_AFFINITY=verbose
        output instead of processor groups when sockets=processor groups.
      * The topology's capacity is modified to handle additional topology layers
        without the need for reallocation.
      * If a user asks for a granularity setting that is "above" the processor
        group layer, then the granularity is adjusted "down" to the processor
        group since this is the coarsest layer available for threads.
      
      Differential Revision: https://reviews.llvm.org/D112273
      286094af
    • Peyton, Jonathan L's avatar
      [OpenMP][libomp] Add support for offline CPUs in Linux · 1dd79716
      Peyton, Jonathan L authored
      If some CPUs are offline, then make sure they are not included in the
      fullMask even if norespect is given to KMP_AFFINITY.
      
      Differential Revision: https://reviews.llvm.org/D112274
      1dd79716
    • Greg McGary's avatar
      [lld-macho][nfc] Factor-out NFC changes from main __eh_frame diff · 9cc489a4
      Greg McGary authored
      In order to keep signal:noise high for the `__eh_frame` diff, I have teased-out the NFC changes and put them here.
      
      Differential Revision: https://reviews.llvm.org/D114017
      9cc489a4
    • Jacques Pienaar's avatar
      [mlir] Improve documentation of shape dialect · 0d0c46a3
      Jacques Pienaar authored
      Add small example of usage (brief which will be further refined).
      0d0c46a3
    • Nathan Ridge's avatar
      [clang] Allocate 2 bits to store the constexpr specifier kind when serializing · 7a8c7946
      Nathan Ridge authored
      Now that consteval and constinit are possible values, 1 bit
      is no longer enough.
      
      Fixes https://github.com/clangd/clangd/issues/887
      
      Differential Revision: https://reviews.llvm.org/D111971
      7a8c7946
    • Alex Zinenko's avatar
      [mlir] Fix wrong variable name in Linalg OpDSL · bca003de
      Alex Zinenko authored
      The name seems to have been left over from a renaming effort on an unexercised
      codepaths that are difficult to catch in Python. Fix it and add a test that
      exercises the codepath.
      
      Reviewed By: gysit
      
      Differential Revision: https://reviews.llvm.org/D114004
      bca003de
    • owenca's avatar
      e852cc0d
    • Louis Dionne's avatar
      [runtimes][NFC] Remove filenames at the top of the license notice · eb8650a7
      Louis Dionne authored
      We've stopped doing it in libc++ for a while now because these names
      would end up rotting as we move things around and copy/paste stuff.
      This cleans up all the existing files so as to stop the spreading
      as people copy-paste headers around.
      eb8650a7
    • Peyton, Jonathan L's avatar
      [OpenMP][libomp] Allow users to specify KMP_HW_SUBSET in any order · a0afb9d0
      Peyton, Jonathan L authored
      Remove restriction forcing users to specify the KMP_HW_SUBSET value in
      topology order. This patch sorts the user KMP_HW_SUBSET value before
      trying to apply it. For example: 1s,4c,2t is equivalent to 2t,1s,4c
      
      Differential Revision: https://reviews.llvm.org/D112027
      a0afb9d0
    • Lawrence D'Anna's avatar
      [lldb] remove usage of distutils, fix python path on debian/ubuntu · 63270710
      Lawrence D'Anna authored
      distutils is deprecated and will be removed, so we shouldn't be
      using it.
      
      We were using it to compute LLDB_PYTHON_RELATIVE_PATH.
      
      Discussing a similar issue
      [at python.org](https://bugs.python.org/issue41282), Filipe Laíns said:
      
          If you are relying on the value of distutils.sysconfig.get_python_lib()
          as you shown in your system, you probably don't want to. That
          directory (dist-packages) should be for Debian provided packages
          only, so moving to sysconfig.get_path() would be a good thing,
          as it has the correct value for user installed packages on your
          system.
      
      So I propose using a relative path from `sys.prefix` to
      `sysconfig.get_path("platlib")` instead.
      
      On Mac and windows, this results in the same paths as we had before,
      which are `lib/python3.9/site-packages` and `Lib\site-packages`,
      respectively.
      
      On ubuntu however, this will change the path from
      `lib/python3/dist-packages` to `lib/python3.9/site-packages`.
      
      Th...
      63270710
    • Louis Dionne's avatar
    • Yitzhak Mandelbaum's avatar
    • Nico Weber's avatar
      [clang] Fix typo in 36873fb7 · 3623163a
      Nico Weber authored
      3623163a
    • Nico Weber's avatar
      [clang] Try to fix test more after ae98182c · 36873fb7
      Nico Weber authored
      We need to use the td-based marshalling instead of doing this manually,
      else the setting gets lost on the way to codegen in most build configs.
      36873fb7
    • Jonathan Peyton's avatar
    • Philip Reames's avatar
      [SCEVAA] Avoid forming malformed pointer diff expressions · ad69402f
      Philip Reames authored
      This solves the same crash as in D104503, but with a different approach.
      
      The test case test_non_dom demonstrates a case where scev-aa crashes today. (If exercised either by -eval-aa or -licm.) The basic problem is that SCEV-AA expects to be able to compute a pointer difference between two SCEVs for any two pair of pointers we do an alias query on. For (valid, but out of scope) reasons, we can end up asking whether expressions in different sub-loops can alias each other. This results in a subtraction expression being formed where neither operand dominates the other.
      
      The approach this patch takes is to leverage the "defining scope" notion we introduced for flag semantics to detect and disallow the formation of the problematic SCEV. This ends up being relatively straight forward on that new infrastructure. This change does hint that we should probably be verifying a similar property for all SCEVs somewhere, but I'll leave that to a follow on change.
      
      Differential Revision: D114112
      ad69402f
    • Michael Liao's avatar
      Fix -Wparentheses warnings. NFC. · b861c360
      Michael Liao authored
      b861c360
    • Jonas Paulsson's avatar
      [SystemZ] [Sanitizer] Bugfixes in internal_clone(). · 4c32e3d9
      Jonas Paulsson authored
      The __flags variable needs to be of type 'long' in order to get sign extended
      properly.
      
      internal_clone() uses an svc (Supervisor Call) directly (as opposed to
      internal_syscall), and therefore needs to take care to set errno and return
      -1 as needed.
      
      Review: Ulrich Weigand
      4c32e3d9
    • Simon Pilgrim's avatar
      [X86] splitVector - only extract lower half subvector from splats · 5f99f771
      Simon Pilgrim authored
      If we're splitting a source vector that is a splat (with no undefs), just extract (for free) the lower half subvector and use it for both halfs.
      5f99f771
    • Nico Weber's avatar
      [clang] Try to fix test after ae98182c · a11d27f4
      Nico Weber authored
      The test assumes an integrated assembler, so use a triple where
      that's the default.
      a11d27f4
    • Pavel Labath's avatar
      [lldb] Port PlatformWindows, PlatformOpenBSD and PlatformRemoteGDBServer to... · 1b468f1c
      Pavel Labath authored
      [lldb] Port PlatformWindows, PlatformOpenBSD and PlatformRemoteGDBServer to GetSupportedArchitectures
      1b468f1c
    • Nico Weber's avatar
      [clang] Address review comments on https://reviews.llvm.org/D113707 · b1ad813b
      Nico Weber authored
      - Drop a needless `l` size suffix on a mov instruction in AT&T mode
      - Move varying bits of test flags to front
      - Add a comment about MS mode test
      b1ad813b
    • Michael Jones's avatar
      [libc] fix strtof/d/ld NaN parsing · 47d0c83e
      Michael Jones authored
      Fix the fact that previously strtof/d/ld would only accept a NaN as
      having parentheses if the thing in the parentheses was a valid number,
      now it will accept any combination of letters and numbers, but will only
      put valid numbers in the mantissa.
      
      Reviewed By: sivachandra
      
      Differential Revision: https://reviews.llvm.org/D113790
      47d0c83e
    • Simon Pilgrim's avatar
      3020608b
    • Simon Pilgrim's avatar
      [X86] LowerRotate - improve vXi8 rotate-by-scalar lowering with direct use of... · e76032c1
      Simon Pilgrim authored
      [X86] LowerRotate - improve vXi8 rotate-by-scalar lowering with direct use of (extended) shift-by-scalar helpers.
      
      If we're rotating vXi8 by a splatted amount, then unpack to vXi16, perform a SHL by the (extended) scalar, and then pack the results.
      
      This is a vector equivalent to the "rotl(x,y) -> (((aext(x) << bw) | zext(x)) << (y & (bw-1))) >> bw" style expansion we do for scalars in LowerFunnelShift.
      
      I think we can usefully use this for other vector types and vector funnel-shifts in the future, depending how we expand beyond D113192 for matching rotations/funnel-shifts for more type/ops.
      e76032c1
    • Mike Rice's avatar
      [OpenMP] Add version macro support for 5.1 and 5.2 · 69f35f89
      Mike Rice authored
      Differential Revision: https://reviews.llvm.org/D114102
      69f35f89
    • Stanislav Mekhanoshin's avatar
      [InstCombine] Generalize complex OR patterns to AND · 6d3db280
      Stanislav Mekhanoshin authored
      For every pattern with only NOT, OR, and AND operations there is
      always a symmetrical attern with AND and OR swapped.
      
      This adds 2 transformations: https://reviews.llvm.org/D113526
      
      ```
      (~(a & b) | c) & (~(a & c) | b) --> ~((b ^ c) & a)
      (~(a & b) | c) & ~(a & c) --> ~((b | c) & a)
      ```
      
      ```
      ----------------------------------------
      define i4 @src(i4 %a, i4 %b, i4 %c) {
      %0:
        %and1 = and i4 %b, %a
        %not1 = xor i4 %and1, 15
        %and2 = and i4 %a, %c
        %not2 = xor i4 %and2, 15
        %or = or i4 %not2, %b
        %r = and i4 %or, %not1
        ret i4 %r
      }
      =>
      define i4 @tgt(i4 %a, i4 %b, i4 %c) {
      %0:
        %or = or i4 %b, %c
        %and = and i4 %or, %a
        %r = xor i4 %and, 15
        ret i4 %r
      }
      Transformation seems to be correct!
      
      ----------------------------------------
      define i4 @src(i4 %a, i4 %b, i4 %c) {
      %0:
        %and1 = and i4 %a, %b
        %not1 = xor i4 %and1, 15
        %or1 = or i4 %not1, %c
        %and2 = and i4 %a, %c
        %not2 = xor i4 %and2, 15
        %or2 = or i4 %not2, %b
        %and3 = and i4 %or1, %or2
        ret i4 %and3
      }
      =>
      define i4 @tgt(i4 %a, i4 %b, i4 %c) {
      %0:
        %xor = xor i4 %b, %c
        %and = and i4 %xor, %a
        %not = xor i4 %and, 15
        ret i4 %not
      }
      Transformation seems to be correct!
      ```
      
      Differential Revision: https://reviews.llvm.org/D113526
      6d3db280
    • Nico Weber's avatar
      [llvm-objcopy] Fix some comment typos · 1718fe46
      Nico Weber authored
      1718fe46
    • Nico Weber's avatar
      [clang] Make -masm=intel affect inline asm style · ae98182c
      Nico Weber authored
      With this,
      
        void f() {  __asm__("mov eax, ebx"); }
      
      now compiles with clang with -masm=intel.
      
      This matches gcc.
      
      The flag is not accepted in clang-cl mode. It has no effect on
      MSVC-style `__asm {}` blocks, which are unconditionally in intel
      mode both before and after this change.
      
      One difference to gcc is that in clang, inline asm strings are
      "local" while they're "global" in gcc. Building the following with
      -masm=intel works with clang, but not with gcc where the ".att_syntax"
      from the 2nd __asm__() is in effect until file end (or until a
      ".intel_syntax" somewhere later in the file):
      
        __asm__("mov eax, ebx");
        __asm__(".att_syntax\nmovl %ebx, %eax");
        __asm__("mov eax, ebx");
      
      This also updates clang's intrinsic headers to work both in
      -masm=att (the default) and -masm=intel modes.
      The official solution for this according to "Multiple assembler dialects in asm
      templates" in gcc docs->Extensions->Inline Assembly->Extended Asm
      is to write every inline asm snippet twice:
      
          bt{l %[Offset],%[Base] | %[Base],%[Offset]}
      
      This works in LLVM after D113932 and D113894, so use that.
      
      (Just putting `.att_syntax` at the start of the snippet works in some but not
      all cases: When LLVM interpolates in parameters like `%0`, it uses at&t or
      intel syntax according to the inline asm snippet's flavor, so the `.att_syntax`
      within the snippet happens to late: The interpolated-in parameter is already
      in intel style, and then won't parse in the switched `.att_syntax`.)
      
      It might be nice to invent a `#pragma clang asm_dialect push "att"` /
      `#pragma clang asm_dialect pop` to be able to force asm style per snippet,
      so that the inline asm string doesn't contain the same code in two variants,
      but let's leave that for a follow-up.
      
      Fixes PR21401 and PR20241.
      
      Differential Revision: https://reviews.llvm.org/D113707
      ae98182c
    • Keith Smiley's avatar
      [llvm-objcopy][MachO] Add llvm-strip support for newer load commands · 68311f21
      Keith Smiley authored
      Previously llvm-strip would fail because of unknown commands.
      
      Fixes https://bugs.llvm.org/show_bug.cgi?id=50044
      
      Differential Revision: https://reviews.llvm.org/D113734
      68311f21
    • Louis Dionne's avatar
      [libc++] Refactor tests for trivially copyable atomics · 3e957e5d
      Louis Dionne authored
      - Replace irrelevant synopsis by a comment
      - Use a .verify.cpp test instead of .compile.fail.cpp
      - Remove unnecessary includes in one of the tests (was a copy-paste error)
      
      Differential Revision: https://reviews.llvm.org/D114094
      3e957e5d
    • Nico Weber's avatar
      [x86/asm] Let EmitMSInlineAsmStr() handle variants too · bf834b26
      Nico Weber authored
      This is preparation for D113707, where I want to make `-masm=intel`
      emit `asm inteldialect` instructions.
      
      `{movq %rbx, %rax|mov rax, rbx}` is supposed to evaluate to the bit
      between { and | for att and to the bit between | and } for intel.
      Since intel will become `asm inteldialect`, which alls EmitMSInlineAsmStr(),
      EmitMSInlineAsmStr() has to support variants as well.
      
      (clang translates `{...|...}` to `$(...$|...$)`. I'm not sure why
      it doesn't just send along only the first `...` or the second `...`
      to LLVM, but given the notes in PR23933 let's not do a big
      reorganization in this codepath.)
      
      Differential Revision: https://reviews.llvm.org/D113932
      bf834b26
    • Craig Topper's avatar
      [RISCV] Lower vector CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF by converting to FP and... · 0274be28
      Craig Topper authored
      [RISCV] Lower vector CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF by converting to FP and extracting the exponent.
      
      If we have a large enough floating point type that can exactly
      represent the integer value, we can convert the value to FP and
      use the exponent to calculate the leading/trailing zeros.
      
      The exponent will contain log2 of the value plus the exponent bias.
      We can then remove the bias and convert from log2 to leading/trailing
      zeros.
      
      This doesn't work for zero since the exponent of zero is zero so we
      can only do this for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF. If we need
      a value for zero we can use a vmseq and a vmerge to handle it.
      
      We need to be careful to make sure the floating point type is legal.
      If it isn't we'll continue using the integer expansion. We could split the vector
      and concatenate the results but that needs some additional work and evaluation.
      
      Differential Revision: https://reviews.llvm.org/D111904
      0274be28
    • Nico Weber's avatar
      [x86/asm] Make variants work when converting at&t inline asm input to intel asm output · 103cc914
      Nico Weber authored
      `asm` always has AT&T-style input (`asm inteldialect` has Intel-style asm
      input), so EmitGCCInlineAsmStr() always has to pick the same variant since it
      cares about the input asm string, not the output asm string.
      
      For PowerPC, that default variant is 1. For other targets, it's 0.
      
      Without this, the included test case errors out with
      
          error: unknown use of instruction mnemonic without a size suffix
                   mov rax, rbx
      
      since it picks the intel branch and then tries to interpret it as AT&T
      when selecting intel-style output with `-x86-asm-syntax=intel`.
      
      Differential Revision: https://reviews.llvm.org/D113894
      103cc914
    • Kadir Cetinkaya's avatar
      [clangd] Dont include file version in task name · e76e5729
      Kadir Cetinkaya authored
      This will drop file version information from span names, reducing
      overall cardinality and also effect logging when skipping actions in scheduler.
      
      Differential Revision: https://reviews.llvm.org/D113390
      e76e5729