1. Oct 07, 2021
    • Chen Zheng's avatar
      [PowerPC] refactor rewriteLoadStores for reusing; nfc · 1bf05fbc
      Chen Zheng authored
      This is split from https://reviews.llvm.org/D108750.
      Refactor rewriteLoadStores() so that we can reuse the outlined
      functions.
      
      Reviewed By: jsji
      
      Differential Revision: https://reviews.llvm.org/D110314
      1bf05fbc
    • David Spickett's avatar
      [libcxx][pretty printers] Correct tests run detection · 7ee133d3
      David Spickett authored
      Missing "global" meant that we set a local "has_run_tests"
      so the global was False by the time everything has run.
      7ee133d3
    • David Green's avatar
      [ARM] Introduce a MQPRCopy · 73346f58
      David Green authored
      Currently when creating tail predicated loops, we need to validate that
      all the live-outs of a loop will be equivalent with and without tail
      predication, and if they are not we cannot legally create a
      tail-predicated loop, leaving expensive vctp and vpst instructions in
      the loop. These notably can include register-allocation instructions
      like stack loads and stores, and copys lowered from COPYs to MVE_VORRs.
      
      Instead of trying to prove this is valid late in the pipeline, this
      patch introduces a MQPRCopy pseudo instruction that COPY is lowered to.
      This can then either be converted to a MVE_VORR where possible, or to a
      couple of VMOVD instructions if not. This way they do not behave
      differently within and outside of tail-predications regions, and we can
      know by construction that they are always valid. The idea is that we can
      do the same with stack load and stores, converting them to VLDR/VSTR or
      VLDM/VSTM where required to prove tail predication is always valid.
      
      This does unfortunately mean inserting multiple VMOVD instructions,
      instead of a single MVE_VORR, but my experiments show it to be an
      improvement in general.
      
      Differential Revision: https://reviews.llvm.org/D111048
      73346f58
    • Carl Ritson's avatar
      [MachineCopyPropagation] Handle propagation of undef copies · b5d6ad20
      Carl Ritson authored
      When propagating undefined copies the undef flag must also be
      propagated.
      
      Reviewed By: foad
      
      Differential Revision: https://reviews.llvm.org/D111219
      b5d6ad20
    • Raphael Isemann's avatar
      [lldb] Rewrite/expand TestCppTypedef and document a lookup bug. · 322e13b9
      Raphael Isemann authored
      Just regrouping the checks for the same typedef together and also giving the
      different typedefs unique names. We might want to have a second test with
      identical names to see how LLDB handle the potential name conflict, but that
      should be a separate test and not part of the main typedef test.
      
      Also this test is actually unintentionally passing. LLDB can't lookup typedefs
      in a struct/class scope, but in the test the check passes as the local variable
      in the expression evaluation scope pulls in the typedef. I added a second check
      that makes it clear that this is not working right now.
      322e13b9
    • Pavel Labath's avatar
      [lldb/gdb-remote] Delete SendPacketsAndConcatenateResponses · 81a2f393
      Pavel Labath authored
      ReadExtFeature provides equivalent functionality. Also fix a but in
      ReadExtFeature, which prevented it from being used for auxv data (it
      contains nul characters).
      81a2f393
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
      b4f4bc0a
    • Simon Pilgrim's avatar
      bb8dfefb
    • Simon Pilgrim's avatar
      e5fa6845
    • Simon Pilgrim's avatar
      05910b6b
    • Jon Chesterfield's avatar
      [libomptarget] Move device environment to shared header, remove divergence · 0c554a47
      Jon Chesterfield authored
      Follow on to D110006, related to D110957
      
      Where implementations have diverged this resolves to match the new DeviceRTL
      
      - replaces definitions of this struct in deviceRTL and plugins with include
      - changes the dynamic_shared_size field from D110006 to 32 bits
      - handles stdint being unavailable in DeviceRTL
      - adds a zero initializer for the field to amdgpu
      - moves the extern declaration for deviceRTL to target_interface
        (omptarget.h is more natural, but doesn't work due to include order
        with debug.h)
      - Renames the fields everywhere to match the LLVM format used in DeviceRTL
      - Makes debug_level uint32_t everywhere (previously sometimes int32_t)
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D111069
      0c554a47
    • Balázs Kéri's avatar
      [clang][ASTImporter] Simplify code of attribute import [NFC]. · b7ac68d0
      Balázs Kéri authored
      The code of `ASTImporter::Import(const Attr *)` was repetitive,
      it is now simplified. (There is still room for improvement but
      probably only after big changes.)
      
      Reviewed By: martong, steakhal
      
      Differential Revision: https://reviews.llvm.org/D110810
      b7ac68d0
    • David Green's avatar
    • David Spickett's avatar
      [libcxx][pretty printers] Report not being able to trace test program · 88f08899
      David Spickett authored
      If you don't have ptrace permissions this test will fail to run
      silently, this adds a check for that and anything else that
      might do similar things.
      
      The output will now be:
      ```
      FAILED test program did not run correctly, check gdb warnings
      
      /usr/bin/gdb: warning: Couldn't determine a path for the index cache
      directory.
      No symbol table is loaded.  Use the "file" command.
      warning: Error disabling address space randomization: Operation not
      permitted
      warning: Could not trace the inferior process.
      warning: ptrace: Operation not permitted
      
      error: command failed with exit status: 255
      ```
      
      We already have a feature to check for a compatible python enabled
      gdb, so I think it's reasonable to check for this at test runtime.
      
      Note that this is different to the catch all at the end of the test
      script. That would be a case where you can trace but something else
      made it stop mid way that wasn't our test breakpoints.
      
      Reviewed By: saugustine
      
      Differential Revision: https://reviews.llvm.org/D110936
      88f08899
    • Pavel Labath's avatar
      Recommit: [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo · 202af507
      Pavel Labath authored
      The previous version of the patch did not update the definitions in
      conditionally compiled code. This patch includes changes to ARC and
      windows targets.
      
      Original commit message was:
      
      These were added to support some mips registers on linux, but linux mips
      support has now been removed due.
      
      They are still referenced in the freebds mips implementation, but the
      completeness of that implementation is also unknown. All other
      architectures just set these fields to zero, which is a cause of
      significant bloat in our register info definitions.
      
      Arm also has registers with variable sizes, but they were implemented in
      a more gdb-compatible fashion and don't use this feature.
      
      Differential Revision: https://reviews.llvm.org/D110914
      202af507
    • Jay Foad's avatar
      [TwoAddressInstruction] Fix ReplacedAllUntiedUses in processTiedPairs · df2d4bc4
      Jay Foad authored
      Fix the calculation of ReplacedAllUntiedUses when any of the tied defs
      are early-clobber. The effect of this is to fix the placement of kill
      flags on an instruction like this (from @f2 in
       test/CodeGen/SystemZ/asm-18.ll):
      
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], killed %4:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      After TwoAddressInstruction without this patch:
      
        %3:grh32bit = COPY killed %4:grh32bit
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      Note that the COPY kills %4, even though there is a later use of %4 in
      the INLINEASM. This fails machine verification if you force it to run
      after TwoAddressInstruction (currently it is disabled for other
      reasons).
      
      After TwoAddressInstruction with this patch:
      
        %3:grh32bit = COPY %4:grh32bit
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      Differential Revision: https://reviews.llvm.org/D110848
      df2d4bc4
    • Jay Foad's avatar
      85abedd7
    • Adrian Kuegel's avatar
      [mlir] Don't allow dynamic extent tensor types for ConstShapeOp. · 2bb208dd
      Adrian Kuegel authored
      ConstShapeOp has a constant shape, so its type can always be static.
      We still allow it to have ShapeType though.
      
      Differential Revision: https://reviews.llvm.org/D111139
      2bb208dd
    • Cullen Rhodes's avatar
      [AArch64][SME] Update DUP (predicate) instruction · 14cb138b
      Cullen Rhodes authored
      Changes in architecture revision 00eac1:
        * Renamed to PSEL.
        * Copies whole source register.
        * Element type suffix removed from destination.
        * Element index no longer optional and '#' prefix has been removed.
      
      The reference can be found here:
      https://developer.arm.com/documentation/ddi0602/2021-09
      
      Depends on D111212.
      
      Reviewed By: kmclaughlin
      
      Differential Revision: https://reviews.llvm.org/D111213
      14cb138b
    • Cullen Rhodes's avatar
      [AArch64][SME] Update tile slice index offset · 42ba79b7
      Cullen Rhodes authored
      Changes in architecture revision 00eac1:
        * Tile slice index offset no longer prefixed with '#'.
        * The syntax for 128-bit (.Q) ZA tile slice accesses must now include
          an explicit zero index.
      
      The reference can be found here:
      https://developer.arm.com/documentation/ddi0602/2021-09
      
      Reviewed By: david-arm
      
      Differential Revision: https://reviews.llvm.org/D111212
      42ba79b7
    • Florian Hahn's avatar
      [VPlan] Replace hard-coded VPValue ids with patterns in tests. · 09fdfd03
      Florian Hahn authored
      This makes the tests a bit more robust with respect to small changes in
      the value numbering.
      09fdfd03
    • David Spickett's avatar
      [libcxx][pretty printers] Correct locale for u16/u32 string tests · 17608d34
      David Spickett authored
      When the locale is not some UTF-8 these tests fail.
      (different results for python2 linked gdbs vs. python3
      but same issue)
      
      Setting the locale just for the test works around this.
      By default Ubuntu comes with just C.UTF-8. I've chosen
      to use en_US.UTF-8 instead given that my Mac doesn't have
      the former and there's a slim chance this test might run there.
      
      This also enables the u16string tests which are now passing.
      
      Reviewed By: #libc, ldionne, saugustine
      
      Differential Revision: https://reviews.llvm.org/D111138
      17608d34
    • David Spickett's avatar
      [libcxx][CI] Install all locales used by the test suite · da593765
      David Spickett authored
      Reviewed By: #libc, ldionne
      
      Differential Revision: https://reviews.llvm.org/D111235
      da593765
    • Tobias Gysi's avatar
      [mlir][linalg] Add unsigned min/max/cast function to OpDSL. · 3fe7fe44
      Tobias Gysi authored
      Update OpDSL to support unsigned integers by adding unsigned min/max/cast signatures. Add tests in OpDSL and on the C++ side to verify the proper signed and unsigned operations are emitted.
      
      The patch addresses an issue brought up in https://reviews.llvm.org/D111170.
      
      Reviewed By: rsuderman
      
      Differential Revision: https://reviews.llvm.org/D111230
      3fe7fe44
    • Saiyedul Islam's avatar
      06404d54
    • Mikael Holmen's avatar
      9bf5d913
    • Saiyedul Islam's avatar
      [Clang][OpenMP] Add partial support for Static Device Libraries · 4c411708
      Saiyedul Islam authored
      An archive containing device code object files can be passed to
      clang command line for linking. For each given offload target
      it creates a device specific archives which is either passed to llvm-link
      if the target is amdgpu, or to clang-nvlink-wrapper if the target is
      nvptx. -L/-l flags are used to specify these fat archives on the command
      line. E.g.
        clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp -L. -lmylib
      
      It currently doesn't support linking an archive directly, like:
        clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp libmylib.a
      
      Linking with x86 offload also does not work.
      
      Reviewed By: ye-luo
      
      Differential Revision: https://reviews.llvm.org/D105191
      4c411708
    • hsmahesha's avatar
      [CFE][Codegen] Update auto-generated check lines for few GPU lit tests · 393581d8
      hsmahesha authored
      which is essentially required as a pre-commit for https://reviews.llvm.org/D110257.
      
      Reviewed By: yaxunl
      
      Differential Revision: https://reviews.llvm.org/D110676
      393581d8
    • Jason Molenda's avatar
      Don't register mem segments that aren't present in a corefile · 62d91638
      Jason Molenda authored
      A Mach-O corefile has an array of memory segments, representing
      the memory of the process at the point of the capture.  Each segment
      has a virtual address + size, and a file offset + size.  The file
      size may be less than the virtual address size, indicating that
      the memory was unavailable. When ProcessMachCore::DoLoadCore scans
      this array of memory segments, it builds up a table to translate
      virtual addresses to file offsets, for memory read requests.
      This lookup table combines contiguous memory segments into a single
      entry, to reduce the number of entries (some corefile writers will
      emit a separate segement for each virtual meory page).
      
      This contiguous check wasn't taking into account a segment that
      isn't present in the corefile, e.g. filesize==0, and every contiguous
      memory segment after that point would result in lldb reading the
      wrong offset of the file because it didn't account for this.
      
      I'd like to have an error message when someone tries to read memory from
      one of these segments, instead of returning all zeroes, so this patch
      intentionally leaves these out of the vmaddr -> fileoff table (and
      avoids combining them with segments that actually do exist in the
      corefile).
      
      I'm a little unsure of writing a test for this one; I'd have to do
      a yaml2obj of a corefile with the problem, or add an internal mode
      to the Mach-O process save-core where it could write a filesize==0
      segment while it was writing one.
      
      rdar://83382487
      62d91638
    • Jason Molenda's avatar
      Update TODO noting that DriverKit should be added too · 809652c9
      Jason Molenda authored
      When BridgeOS and DriverKit are added to llvm Triple.
      809652c9
    • Uday Bondhugula's avatar
      [MLIR] Add OrOp folding rule for constant one operand · 1e39d32c
      Uday Bondhugula authored
      Add folding rule for std.or op when an operand has all bits set.
      
      or(x, <all bits set>) -> <all bits set>
      
      Differential Revision: https://reviews.llvm.org/D111206
      1e39d32c
    • Itay Bookstein's avatar
      [IR][NFC] Rename getBaseObject to getAliaseeObject · 40ec1c0f
      Itay Bookstein authored
      To better reflect the meaning of the now-disambiguated {GlobalValue,
      GlobalAlias}::getBaseObject after breaking off GlobalIFunc::getResolverFunction
      (D109792), the function is renamed to getAliaseeObject.
      40ec1c0f
    • Artem Belevich's avatar
      [CUDA] remove unneeded includes from CUDA-related headers. · 6707a7d7
      Artem Belevich authored
      This should fix bot failures on PPC and windows.
      6707a7d7
    • Mogball's avatar
      [MLIR] fix arith dialect build failure · 8f0c673d
      Mogball authored
      Missing function defs causes errors on some build configs.
      8f0c673d
    • David Blaikie's avatar
      DebugInfo: Use clang's preferred names for integer types · f6a561c4
      David Blaikie authored
      This reverts c7f16ab3 / r109694 - which
      suggested this was done to improve consistency with the gdb test suite.
      Possible that at the time GCC did not canonicalize integer types, and so
      matching types was important for cross-compiler validity, or that it was
      only a case of over-constrained test cases that printed out/tested the
      exact names of integer types.
      
      In any case neither issue seems to exist today based on my limited
      testing - both gdb and lldb canonicalize integer types (in a way that
      happens to match Clang's preferred naming, incidentally) and so never
      print the original text name produced in the DWARF by GCC or Clang.
      
      This canonicalization appears to be in `integer_types_same_name_p` for
      GDB and in `TypeSystemClang::GetBasicTypeEnumeration` for lldb.
      
      (I tested this with one translation unit defining 3 variables - `long`,
      `long (*)()`, and `int (*)()`, and another translation unit that had
      main, and a function that took `long (*)()` as a parameter - then
      compiled them with mismatched compilers (either GCC+Clang, or
      Clang+(Clang with this patch applied)) and no matter the combination,
      despite the debug info for one CU naming the type "long int" and the
      other naming it "long", both debuggers printed out the name as "long"
      and were able to correctly perform overload resolution and pass the
      `long int (*)()` variable to the `long (*)()` function parameter)
      
      Did find one hiccup, identified by the lldb test suite - that CodeView
      was relying on these names to map them to builtin types in that format.
      So added some handling for that in LLVM. (these could be split out into
      separate patches, but seems small enough to not warrant it - will do
      that if there ends up needing any reverti/revisiting)
      
      Differential Revision: https://reviews.llvm.org/D110455
      f6a561c4
    • Kuba Mracek's avatar
      [GlobalDCE] In VFE, replace the whole 'sub' expression of unused... · 7329abf2
      Kuba Mracek authored
      [GlobalDCE] In VFE, replace the whole 'sub' expression of unused relative-pointer-based vtable slots
      
      Differential Revision: https://reviews.llvm.org/D109114
      7329abf2
    • Stella Laurenzo's avatar
      Return failure on failure in convertBlockSignature. · 56272257
      Stella Laurenzo authored
      This was causing a subsequent assert/crash when a type converter failed to convert a block argument.
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D110985
      56272257
    • LLVM GN Syncbot's avatar
      [gn build] Port ccfb0555 · ae4c0c7c
      LLVM GN Syncbot authored
      ae4c0c7c
    • Artem Belevich's avatar
      [CUDA] Implement experimental support for texture lookups. · ccfb0555
      Artem Belevich authored
      The patch implements header-only support for testure lookups.
      
      The patch has been tested on a source file with all possible combinations of
      argument types supported by CUDA headers, compiled and verified that the
      generated instructions and their parameters match the code generated by NVCC.
      Unfortunately, compiling texture code requires CUDA headers and can't be tested
      in clang itself.  The test will need to be added to the test-suite later.
      
      While generated code compiles and seems to match NVCC, I do not have any code
      that uses textures that I could test correctness of the implementation. Hence
      the experimental status.
      
      Differential Revision: https://reviews.llvm.org/D110089
      ccfb0555