Skip to content

Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)"#188344

Merged
joker-eph merged 1 commit into
llvm:mainfrom
joker-eph:revert_build_failure
Mar 24, 2026
Merged

Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)"#188344
joker-eph merged 1 commit into
llvm:mainfrom
joker-eph:revert_build_failure

Conversation

@joker-eph

@joker-eph joker-eph commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

This reverts commit b1aa6a4 and commit ce44d63.

This fails the build with some older gcc:

llvm/include/llvm/CodeGenTypes/LowLevelType.h:501:35: error: call to non-constexpr function ‘static llvm::LLT llvm::LLT::integer(unsigned int)’
return integer(getSizeInBits());
^

…c128float and others in GlobalISel) (llvm#155107)"

This reverts commit b1aa6a4 and commit ce44d63.

This fails the build with some older gcc:

llvm/include/llvm/CodeGenTypes/LowLevelType.h:501:35: error: call to non-constexpr function ‘static llvm::LLT llvm::LLT::integer(unsigned int)’
     return integer(getSizeInBits());
                                   ^
@joker-eph joker-eph added the skip-precommit-approval PR for CI feedback, not intended for review label Mar 24, 2026
@joker-eph joker-eph changed the title Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, pp… Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)" Mar 24, 2026
@joker-eph
joker-eph enabled auto-merge (squash) March 24, 2026 20:58
@github-actions

Copy link
Copy Markdown

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h llvm/include/llvm/CodeGen/LowLevelTypeUtils.h llvm/include/llvm/CodeGen/TargetLowering.h llvm/include/llvm/CodeGenTypes/LowLevelType.h llvm/lib/CodeGen/GlobalISel/CallLowering.cpp llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp llvm/lib/CodeGen/GlobalISel/LegalizeMutations.cpp llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp llvm/lib/CodeGen/GlobalISel/Utils.cpp llvm/lib/CodeGen/LowLevelTypeUtils.cpp llvm/lib/CodeGen/MIRParser/MIParser.cpp llvm/lib/CodeGen/MachineVerifier.cpp llvm/lib/CodeGenTypes/LowLevelType.cpp llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTableExecutorEmitter.cpp llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTableExecutorEmitter.h --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
index 51a298eb8..f0c1758a4 100644
--- a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
+++ b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
@@ -41,6 +41,6 @@ LLVM_ABI LLT getLLTForMVT(MVT Ty);
 /// Get the appropriate floating point arithmetic semantic based on the bit size
 /// of the given scalar LLT.
 LLVM_ABI const llvm::fltSemantics &getFltSemanticForLLT(LLT Ty);
-}
+} // namespace llvm
 
 #endif // LLVM_CODEGEN_LOWLEVELTYPEUTILS_H
diff --git a/llvm/include/llvm/CodeGenTypes/LowLevelType.h b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
index 92def9209..70501c654 100644
--- a/llvm/include/llvm/CodeGenTypes/LowLevelType.h
+++ b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
@@ -41,8 +41,9 @@ class LLT {
 public:
   /// Get a low-level scalar or aggregate "bag of bits".
   static constexpr LLT scalar(unsigned SizeInBits) {
-    return LLT{/*isPointer=*/false, /*isVector=*/false, /*isScalar=*/true,
-               ElementCount::getFixed(0), SizeInBits,
+    return LLT{/*isPointer=*/false, /*isVector=*/false,
+               /*isScalar=*/true,   ElementCount::getFixed(0),
+               SizeInBits,
                /*AddressSpace=*/0};
   }
 
@@ -57,15 +58,17 @@ public:
   /// Get a low-level pointer in the given address space.
   static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits) {
     assert(SizeInBits > 0 && "invalid pointer size");
-    return LLT{/*isPointer=*/true, /*isVector=*/false, /*isScalar=*/false,
-               ElementCount::getFixed(0), SizeInBits, AddressSpace};
+    return LLT{/*isPointer=*/true, /*isVector=*/false,
+               /*isScalar=*/false, ElementCount::getFixed(0),
+               SizeInBits,         AddressSpace};
   }
 
   /// Get a low-level vector of some number of elements and element width.
   static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits) {
     assert(!EC.isScalar() && "invalid number of vector elements");
-    return LLT{/*isPointer=*/false, /*isVector=*/true, /*isScalar=*/false,
-               EC, ScalarSizeInBits, /*AddressSpace=*/0};
+    return LLT{/*isPointer=*/false, /*isVector=*/true,
+               /*isScalar=*/false,  EC,
+               ScalarSizeInBits,    /*AddressSpace=*/0};
   }
 
   /// Get a low-level vector of some number of elements and element type.
@@ -81,20 +84,15 @@ public:
   }
 
   /// Get a 16-bit IEEE half value.
-  /// TODO: Add IEEE semantics to type - This currently returns a simple `scalar(16)`.
-  static constexpr LLT float16() {
-    return scalar(16);
-  }
+  /// TODO: Add IEEE semantics to type - This currently returns a simple
+  /// `scalar(16)`.
+  static constexpr LLT float16() { return scalar(16); }
 
   /// Get a 32-bit IEEE float value.
-  static constexpr LLT float32() {
-    return scalar(32);
-  }
+  static constexpr LLT float32() { return scalar(32); }
 
   /// Get a 64-bit IEEE double value.
-  static constexpr LLT float64() {
-    return scalar(64);
-  }
+  static constexpr LLT float64() { return scalar(64); }
 
   /// Get a low-level fixed-width vector of some number of elements and element
   /// width.
@@ -422,12 +420,12 @@ public:
   }
 };
 
-inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
+inline raw_ostream &operator<<(raw_ostream &OS, const LLT &Ty) {
   Ty.print(OS);
   return OS;
 }
 
-template<> struct DenseMapInfo<LLT> {
+template <> struct DenseMapInfo<LLT> {
   static inline LLT getEmptyKey() {
     LLT Invalid;
     Invalid.IsPointer = true;
@@ -442,11 +440,9 @@ template<> struct DenseMapInfo<LLT> {
     uint64_t Val = Ty.getUniqueRAWLLTData();
     return DenseMapInfo<uint64_t>::getHashValue(Val);
   }
-  static bool isEqual(const LLT &LHS, const LLT &RHS) {
-    return LHS == RHS;
-  }
+  static bool isEqual(const LLT &LHS, const LLT &RHS) { return LHS == RHS; }
 };
 
-}
+} // namespace llvm
 
 #endif // LLVM_CODEGEN_LOWLEVELTYPE_H
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index b813cda34..3bc206e0d 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -8845,11 +8845,11 @@ LegalizerHelper::lowerFCopySign(MachineInstr &MI) {
   const int Src0Size = Src0Ty.getScalarSizeInBits();
   const int Src1Size = Src1Ty.getScalarSizeInBits();
 
-  auto SignBitMask = MIRBuilder.buildConstant(
-    Src0Ty, APInt::getSignMask(Src0Size));
+  auto SignBitMask =
+      MIRBuilder.buildConstant(Src0Ty, APInt::getSignMask(Src0Size));
 
   auto NotSignBitMask = MIRBuilder.buildConstant(
-    Src0Ty, APInt::getLowBitsSet(Src0Size, Src0Size - 1));
+      Src0Ty, APInt::getLowBitsSet(Src0Size, Src0Size - 1));
 
   Register And0 = MIRBuilder.buildAnd(Src0Ty, Src0, NotSignBitMask).getReg(0);
   Register And1;

@joker-eph
joker-eph merged commit 6a045c2 into llvm:main Mar 24, 2026
15 of 17 checks passed
ronlieb pushed a commit to ROCm/llvm-project that referenced this pull request Mar 24, 2026
…c128float and others in GlobalISel) (llvm#155107)" (llvm#188344)

This reverts commit b1aa6a4 and commit
ce44d63.

This fails the build with some older gcc:

llvm/include/llvm/CodeGenTypes/LowLevelType.h:501:35: error: call to
non-constexpr function ‘static llvm::LLT llvm::LLT::integer(unsigned
int)’
     return integer(getSizeInBits());
                                   ^
Aadarsh-Keshri pushed a commit to Aadarsh-Keshri/llvm-project that referenced this pull request Mar 28, 2026
…c128float and others in GlobalISel) (llvm#155107)" (llvm#188344)

This reverts commit b1aa6a4 and commit
ce44d63.

This fails the build with some older gcc:

llvm/include/llvm/CodeGenTypes/LowLevelType.h:501:35: error: call to
non-constexpr function ‘static llvm::LLT llvm::LLT::integer(unsigned
int)’
     return integer(getSizeInBits());
                                   ^
lialan added a commit that referenced this pull request Apr 4, 2026
…c128float and others in GlobalISel) (#155107)" (#188502)

This is a reland of #155107
along with a fix for old gcc builds.

This patch is reverted in
#188344 due to compilation
failures described in
#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Apr 4, 2026
… bfloat, ppc128float and others in GlobalISel) (#155107)" (#188502)

This is a reland of llvm/llvm-project#155107
along with a fix for old gcc builds.

This patch is reverted in
llvm/llvm-project#188344 due to compilation
failures described in
llvm/llvm-project#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e7768c011b8cf2d4d223ca6eca3392b1f9
cpullvm-upstream-sync Bot pushed a commit to navaneethshan/cpullvm-toolchain-1 that referenced this pull request Apr 13, 2026
… bfloat, ppc128float and others in GlobalISel) (#155107)" (#188502)

This is a reland of llvm/llvm-project#155107
along with a fix for old gcc builds.

This patch is reverted in
llvm/llvm-project#188344 due to compilation
failures described in
llvm/llvm-project#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e7768c011b8cf2d4d223ca6eca3392b1f9
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Apr 24, 2026
… bfloat, ppc128float and others in GlobalISel) (#155107)" (#188502)

This is a reland of llvm/llvm-project#155107
along with a fix for old gcc builds.

This patch is reverted in
llvm/llvm-project#188344 due to compilation
failures described in
llvm/llvm-project#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e7768c011b8cf2d4d223ca6eca3392b1f9
zwu-2025 pushed a commit to zwu-2025/llvm-project that referenced this pull request May 17, 2026
…c128float and others in GlobalISel) (llvm#155107)" (llvm#188502)

This is a reland of llvm#155107
along with a fix for old gcc builds.

This patch is reverted in
llvm#188344 due to compilation
failures described in
llvm#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e
markrvmurray pushed a commit to markrvmurray/llvm-mc6809 that referenced this pull request Jun 14, 2026
…c128float and others in GlobalISel) (#155107)" (#188502)

This is a reland of llvm/llvm-project#155107
along with a fix for old gcc builds.

This patch is reverted in
llvm/llvm-project#188344 due to compilation
failures described in
llvm/llvm-project#155107 (comment)

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e7768c011b8cf2d4d223ca6eca3392b1f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants