[llvm-branch-commits] [mlir] e4ec381 - [mlir] Fix Analysis/Presburger/Utils.cpp compilation with GCC 11

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 5 01:16:34 PDT 2022


Author: Rainer Orth
Date: 2022-08-05T01:15:24-07:00
New Revision: e4ec381f2cf538ff9ed5f3deef6280d5912ace77

URL: https://github.com/llvm/llvm-project/commit/e4ec381f2cf538ff9ed5f3deef6280d5912ace77
DIFF: https://github.com/llvm/llvm-project/commit/e4ec381f2cf538ff9ed5f3deef6280d5912ace77.diff

LOG: [mlir] Fix Analysis/Presburger/Utils.cpp compilation with GCC 11

As reported in Issue #56850, mlir/lib/Analysis/Presburger/Utils.cpp doesn't
compile on Solaris 11.4/SPARC with the bundled GCC 11, as seen when testing
LLVM 15.0.0 rc1:

  /var/llvm/reltest/llvm-15.0.0-rc1/rc1/llvm-project/mlir/include/mlir/Analysis/Presburger/MPInt.h:260:47:
error: inlining failed in call to ‘always_inline’ ‘int64_t
mlir::presburger::int64FromMPInt(const mlir::presburger::MPInt&)’: indirect
function call with a yet undetermined callee

This patch hacks around this and allowed the build to finish.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D131060

(cherry picked from commit 75747e6e11aed9ed75d27527e9262cedb2e3f887)

Added: 
    

Modified: 
    mlir/include/mlir/Analysis/Presburger/MPInt.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Analysis/Presburger/MPInt.h b/mlir/include/mlir/Analysis/Presburger/MPInt.h
index e7c2de0a504ad..ab21d32fe9018 100644
--- a/mlir/include/mlir/Analysis/Presburger/MPInt.h
+++ b/mlir/include/mlir/Analysis/Presburger/MPInt.h
@@ -257,9 +257,7 @@ llvm::hash_code hash_value(const MPInt &x); // NOLINT
 /// This just calls through to the operator int64_t, but it's useful when a
 /// function pointer is required. (Although this is marked inline, it is still
 /// possible to obtain and use a function pointer to this.)
-LLVM_ATTRIBUTE_ALWAYS_INLINE int64_t int64FromMPInt(const MPInt &x) {
-  return int64_t(x);
-}
+static inline int64_t int64FromMPInt(const MPInt &x) { return int64_t(x); }
 LLVM_ATTRIBUTE_ALWAYS_INLINE MPInt mpintFromInt64(int64_t x) {
   return MPInt(x);
 }


        


More information about the llvm-branch-commits mailing list