1. Oct 02, 2023
    • Kazu Hirata's avatar
      [BOLT] Fix the initialization of DWARFDataExtractor · a7517e12
      Kazu Hirata authored
      Without this patch, we pass Endian as one of the parameters to the
      constructor of DWARFDataExtractor.  The problem is that Endian is of:
      
        enum endianness {big, little, native};
      
      whereas the constructor is expecting "bool IsLittleEndian".  That is,
      we are relying on an implicit conversion to convert big and little to
      false and true, respectively.
      
      When we migrate llvm::support::endianness to std::endian in future, we
      can no longer rely on an implicit conversion because std::endian is
      declared with "enum class".  Even if we could, the conversion would
      not be guaranteed to work because, for example, libcxx defines:
      
        enum class endian {
          little = 0xDEAD,
          big = 0xFACE,
          :
      
      where big and little are not boolean values.
      
      This patch fixes the problem by properly converting Endian to a
      boolean value.
      a7517e12
    • Kazu Hirata's avatar
      [ExecutionEngine] Fix the call to DWARFContext::create · 8de2ecc2
      Kazu Hirata authored
      Without this patch, we pass G.getEndianness() as one of the parameters
      to DWARFContext::create.  The problem is that G.getEndianness() is of:
      
        enum endianness {big, little, native};
      
      whereas DWARFContext::create is expecting "bool isLittleEndian".  That
      is, we are relying on an implicit conversion to convert big and little
      to false and true, respectively.
      
      When we migrate llvm::support::endianness to std::endian in future, we
      can no longer rely on an implicit conversion because std::endian is
      declared with "enum class".  Even if we could, the conversion would
      not be guaranteed to work because, for example, libcxx defines:
      
        enum class endian {
          little = 0xDEAD,
          big = 0xFACE,
          :
      
      where big and little are not boolean values.
      
      This patch fixes the problem by properly converting G.getEndianness()
      to a boolean value.
      8de2ecc2
    • Zhenyan Zhu's avatar
      [mlir][affine] Enforce each result type to match Reduction ops in affine.parallel verifier · 95804683
      Zhenyan Zhu authored
      This patch updates AffineParallelOp::verify() to check each result type matches
      its corresponding reduction op (i.e, the result type must be a `FloatType` if
      the reduction attribute is `addf`)
      
      affine.parallel will crash on --lower-affine if the corresponding result type
      cannot match the reduction attribute.
      
      ```
            %128 = affine.parallel (%arg2, %arg3) = (0, 0) to (8, 7) reduce ("maxf") -> (memref<8x7xf32>) {
              %alloc_33 = memref.alloc() : memref<8x7xf32>
              affine.yield %alloc_33 : memref<8x7xf32>
            }
      ```
      This will crash and report a type conversion issue when we run `mlir-opt --lower-affine`
      
      ```
      Assertion failed: (isa<To>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file Casting.h, line 572.
      PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
      Stack dump:
      0.	Program arguments: mlir-opt --lower-affine temp.mlir
       #0 0x0000000102a18f18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspacebin/mlir-opt+0x1002f8f18)
       #1 0x0000000102a171b4 llvm::sys::RunSignalHandlers() (/workspacebin/mlir-opt+0x1002f71b4)
       #2 0x0000000102a195c4 SignalHandler(int) (/workspacebin/mlir-opt+0x1002f95c4)
       #3 0x00000001be7894c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
       #4 0x00000001be771ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
       #5 0x00000001be6ac340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
       #6 0x00000001be6ab754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
       #7 0x0000000106864790 mlir::arith::getIdentityValueAttr(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (.cold.4) (/workspacebin/mlir-opt+0x104144790)
       #8 0x0000000102ba66ac mlir::arith::getIdentityValueAttr(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (/workspacebin/mlir-opt+0x1004866ac)
       #9 0x0000000102ba6910 mlir::arith::getIdentityValue(mlir::arith::AtomicRMWKind, mlir::Type, mlir::OpBuilder&, mlir::Location) (/workspacebin/mlir-opt+0x100486910)
      ...
      ```
      
      Fixes #64068
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D157985
      95804683
    • Martin Storsjö's avatar
      [clang] [MinGW] Tolerate mingw specific linker options during compilation (#67891) · e39de2b8
      Martin Storsjö authored
      Prior to 591c4b64, the mingw specific
      linker options -mthreads, -mconsole, -mwindows and -mdll would be
      tolerated also at compile time, but generating a warning about being
      unused.
      
      After that commit, they were marked as target specific, which means that
      it's an error if they're unused (which would consider them used for the
      wrong target). These specific options are only relevant when linking,
      but we want to tolerate them at compile time too, like before.
      
      This was fixed for -mthreads in
      a79995ca, while the other options didn't
      seem to be commonly used during compilation.
      
      After the 17.x release, we've got more reports about this actually being
      an issue, in #64464. Therefore, apply the same fix for them; marking
      them as tolerated for mingw targets during compilation, even if they're
      unused. Also add a testcase for -mthreads which was already handled.
      
      Thus, this fixes #64464.
      e39de2b8
    • Kazu Hirata's avatar
      [GSYM] Fix the initialization of DataExtractor (#67904) · 95f4b2a7
      Kazu Hirata authored
      Without this patch, we pass Endian as one of the parameters to the
      constructor of DataExtractor.  The problem is that Endian is of:
      
        enum endianness {big, little, native};
      
      whereas the constructor is expecting "bool IsLittleEndian".  That is,
      we are relying on an implicit conversion to convert big and little to
      false and true, respectively.
      
      When we migrate llvm::support::endianness to std::endian in future, we
      can no longer rely on an implicit conversion because std::endian is
      declared with "enum class".  Even if we could, the conversion would
      not be guaranteed to work because, for example, libcxx defines:
      
        enum class endian {
          little = 0xDEAD,
          big = 0xFACE,
          :
      
      where big and little are not boolean values.
      
      This patch fixes the problem by properly converting Endian to a
      boolean value.
      95f4b2a7
    • Matthias Springer's avatar
      [mlir][bufferization] Improve verifier for `bufferization.dealloc` (#67912) · 0ef990d5
      Matthias Springer authored
      Check that the number of retained operands and updated conditions match.
      0ef990d5
    • Timm Bäder's avatar
      [clang][Interp] Disable int128 tests on targets that don't have int128 · c77b2ad0
      Timm Bäder authored
      This broke build bots.
      c77b2ad0
  2. Oct 01, 2023
  3. Sep 30, 2023