Revert "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)"#188344
Merged
Conversation
…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
enabled auto-merge (squash)
March 24, 2026 20:58
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
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;
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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());
^