Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6baa709
add isScalar and isFixedVector
tgymnich Oct 4, 2024
cc16885
changeElementCount
tgymnich Feb 6, 2025
f04aed6
FPInfo: LLT changes
tgymnich Feb 12, 2025
79ba6eb
Return default logic for LLT::scalar. Allow target to enable and disa…
DenisGZM Aug 22, 2025
bc4b0ec
Fix MIR tests
DenisGZM Aug 22, 2025
655b85a
enable bfloat in IRTranslator for targets that support it
DenisGZM Aug 22, 2025
b767e6e
[unittest] Added simple IRTranslator test for bf16
DenisGZM Aug 23, 2025
1e5c984
Merge branch 'main' into llt-fpinfo
DenisGZM Aug 23, 2025
82602b7
fixed names
DenisGZM Aug 23, 2025
6485b50
code style fixes
DenisGZM Aug 23, 2025
7167e6b
Merge branch 'main' into llt-fpinfo
DenisGZM Aug 23, 2025
6815b11
Merge branch 'main' into llt-fpinfo
DenisGZM Aug 24, 2025
2db5fdb
Merge branch 'main' into llt-fpinfo
DenisGZM Aug 26, 2025
7dccd7c
Merge branch 'main' into llt-fpinfo
DenisGZM Aug 27, 2025
58be30f
Merge 'main' into 'llt-fpinfo'
DenisGZM Sep 8, 2025
d8c9da0
style
DenisGZM Sep 8, 2025
7c5f7d2
style
DenisGZM Sep 14, 2025
f29a556
Merge branch 'main' into llt-fpinfo
DenisGZM Sep 14, 2025
e1f805c
Review fixes
DenisGZM Sep 19, 2025
59666ff
Merge branch 'main' into llt-fpinfo
DenisGZM Sep 19, 2025
d37eeb8
typo
DenisGZM Sep 22, 2025
f16cd79
Merge 'main' into llt-fpinfo
DenisGZM Sep 22, 2025
aba146b
Small fix in test
DenisGZM Sep 23, 2025
af86aeb
Merge branch 'main' into llt-fpinfo
DenisGZM Sep 23, 2025
bc600c6
Merge 'main' into llt-fpinfo
DenisGZM Sep 27, 2025
8504936
Merge branch 'main' into llt-fpinfo
DenisGZM Oct 13, 2025
72698d9
Merge branch 'main' into llt-fpinfo
DenisGZM Oct 16, 2025
a72d2a3
Fixed misprints
DenisGZM Oct 16, 2025
ce75915
Restructure LLT packed data. LLTCodeGen compare now uses `getUniqueRA…
DenisGZM Oct 17, 2025
21e977b
Merge branch 'main' into llt-fpinfo
DenisGZM Oct 17, 2025
74e1cf8
initialization fix
DenisGZM Oct 17, 2025
547e24a
Merge branch 'main' into llt-fpinfo
DenisGZM Oct 18, 2025
664b644
Link CodeGenTypes to TableGenCommon
DenisGZM Oct 30, 2025
5eeb898
Merge branch 'main' into llt-fpinfo
DenisGZM Oct 30, 2025
00d0905
merge `main` into llt-fpinfo
DenisGZM Nov 10, 2025
cb0dc5f
Fix misprint
DenisGZM Nov 10, 2025
e076732
format
DenisGZM Nov 11, 2025
bc546c1
Merge branch 'main' into llt-fpinfo
DenisGZM Nov 11, 2025
ac562ed
Merge 'main' into 'llt-fpinfo'
DenisGZM Nov 15, 2025
24c0af1
Replace FPVariant with APFloat::Semantics
DenisGZM Nov 15, 2025
282bfd7
Added assert and updated comment
DenisGZM Nov 27, 2025
a10999c
Merge branch 'main' into llt-fpinfo
DenisGZM Nov 27, 2025
af98f63
Added global state for LLT, allowing initialize extended LLTs
DenisGZM Dec 6, 2025
899e79e
Remove TargetOption::EnableGlobalISelExtendedLLT. Targets must use LL…
DenisGZM Dec 6, 2025
54f4b56
merge 'main' into 'llt-fpinfo'
DenisGZM Dec 6, 2025
0fa794a
Fix after merge
DenisGZM Dec 6, 2025
97c7832
review fixes
DenisGZM Dec 21, 2025
0cc745c
Merge 'main' into 'llt-fpinfo'
DenisGZM Dec 21, 2025
3ea8cb8
Merge branch 'main' into llt-fpinfo
DenisGZM Dec 28, 2025
52496f5
Merge branch 'main' into llt-fpinfo
DenisGZM Jan 12, 2026
f8cf186
Add wrapper around type constructors to fallback to scalars when exte…
HolyMolyCowMan Jan 2, 2026
12b9b09
Modify mutations to change the size of types, not the type
DenisGZM Jan 12, 2026
cfed5d4
format
DenisGZM Jan 12, 2026
db8fda6
Merge branch 'main' into llt-fpinfo
DenisGZM Jan 30, 2026
28ada86
fixed bf16 test
DenisGZM Jan 31, 2026
bc21f31
review fixes
DenisGZM Jan 31, 2026
96b1725
Try to match multiple types in the match table. Start with the given …
HolyMolyCowMan Dec 29, 2025
53f8fa3
Modify construction of types to reduce the instances of scalar types …
HolyMolyCowMan Feb 2, 2026
555f66b
Add bitcasts & copies to coerce types when necessary. Allow select fu…
HolyMolyCowMan Feb 2, 2026
776b279
Modify type constructors to use wrapper constructor to allow scalar f…
HolyMolyCowMan Feb 2, 2026
0b51da8
Improve formatting in places
HolyMolyCowMan Feb 2, 2026
555cc57
Update tests
HolyMolyCowMan Feb 2, 2026
187f781
Merge branch 'main' into llt-fpinfo
DenisGZM Feb 2, 2026
941fc40
Merge 'main' into 'llt-fpinfo'
DenisGZM Feb 13, 2026
f0c377b
Merge 'main' into 'llt-fpinfo'
DenisGZM Feb 23, 2026
1799b1b
Revert GIMatchTable patch
DenisGZM Feb 23, 2026
c721fee
review fixes
DenisGZM Feb 23, 2026
84978f5
Merge branch 'main' into llt-fpinfo
DenisGZM Mar 3, 2026
aba480d
Rm redundant builders
DenisGZM Mar 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@ class IRTranslator : public MachineFunctionPass {

StackProtectorDescriptor SPDescriptor;

bool mayTranslateUserTypes(const User &U) const;

/// Switch analysis and optimization.
class GISelSwitchLowering : public SwitchCG::SwitchLowering {
public:
Expand Down
27 changes: 16 additions & 11 deletions llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ LLVM_ABI LegalizeMutation changeElementCountTo(unsigned TypeIdx,
LLVM_ABI LegalizeMutation changeElementSizeTo(unsigned TypeIdx,
unsigned FromTypeIdx);

/// Change the scalar size or element size to have the same scalar size as the
/// type \p NewTy. Unlike changeElementTo, this discards pointer types and only
/// changes the size.
LLVM_ABI LegalizeMutation changeElementSizeTo(unsigned TypeIdx, LLT NewTy);

/// Widen the scalar type or vector element type for the given type index to the
/// next power of 2.
LLVM_ABI LegalizeMutation widenScalarOrEltToNextPow2(unsigned TypeIdx,
Expand Down Expand Up @@ -1040,7 +1045,7 @@ class LegalizeRuleSet {
using namespace LegalizeMutations;
return actionIf(LegalizeAction::WidenScalar,
scalarOrEltNarrowerThan(TypeIdx, Ty.getScalarSizeInBits()),
changeElementTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Ensure the scalar or element is at least as wide as Ty.
Expand All @@ -1051,7 +1056,7 @@ class LegalizeRuleSet {
return actionIf(LegalizeAction::WidenScalar,
all(Predicate, scalarOrEltNarrowerThan(
TypeIdx, Ty.getScalarSizeInBits())),
changeElementTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Ensure the vector size is at least as wide as VectorSize by promoting the
Expand All @@ -1070,7 +1075,8 @@ class LegalizeRuleSet {
const LLT VecTy = Query.Types[TypeIdx];
unsigned NumElts = VecTy.getNumElements();
unsigned MinSize = VectorSize / NumElts;
LLT NewTy = LLT::fixed_vector(NumElts, LLT::scalar(MinSize));
LLT NewTy = LLT::fixed_vector(
NumElts, VecTy.getElementType().changeElementSize(MinSize));
return std::make_pair(TypeIdx, NewTy);
});
}
Expand All @@ -1081,7 +1087,7 @@ class LegalizeRuleSet {
using namespace LegalizeMutations;
return actionIf(LegalizeAction::WidenScalar,
scalarNarrowerThan(TypeIdx, Ty.getSizeInBits()),
changeTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}
LegalizeRuleSet &minScalar(bool Pred, unsigned TypeIdx, const LLT Ty) {
if (!Pred)
Expand All @@ -1102,7 +1108,7 @@ class LegalizeRuleSet {
QueryTy.getSizeInBits() < Ty.getSizeInBits() &&
Predicate(Query);
},
changeTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Ensure the scalar is at most as wide as Ty.
Expand All @@ -1111,7 +1117,7 @@ class LegalizeRuleSet {
using namespace LegalizeMutations;
return actionIf(LegalizeAction::NarrowScalar,
scalarOrEltWiderThan(TypeIdx, Ty.getScalarSizeInBits()),
changeElementTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Ensure the scalar is at most as wide as Ty.
Expand All @@ -1120,7 +1126,7 @@ class LegalizeRuleSet {
using namespace LegalizeMutations;
return actionIf(LegalizeAction::NarrowScalar,
scalarWiderThan(TypeIdx, Ty.getSizeInBits()),
changeTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Conditionally limit the maximum size of the scalar.
Expand All @@ -1138,7 +1144,7 @@ class LegalizeRuleSet {
QueryTy.getSizeInBits() > Ty.getSizeInBits() &&
Predicate(Query);
},
changeElementTo(typeIdx(TypeIdx), Ty));
changeElementSizeTo(typeIdx(TypeIdx), Ty));
}

/// Limit the range of scalar sizes to MinTy and MaxTy.
Expand Down Expand Up @@ -1203,9 +1209,8 @@ class LegalizeRuleSet {
Predicate(Query);
},
[=](const LegalityQuery &Query) {
LLT T = Query.Types[LargeTypeIdx];
if (T.isPointerVector())
T = T.changeElementType(LLT::scalar(T.getScalarSizeInBits()));
LLT T = Query.Types[TypeIdx].changeElementSize(
Query.Types[LargeTypeIdx].getScalarSizeInBits());
return std::make_pair(TypeIdx, T);
});
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class LLVM_ABI TargetLoweringBase {
/// G_INSERT_VECTOR_ELT, G_EXTRACT_VECTOR_ELT,
/// G_INSERT_SUBVECTOR, and G_EXTRACT_SUBVECTOR
LLT getVectorIdxLLT(const DataLayout &DL) const {
return LLT::scalar(getVectorIdxWidth(DL));
return LLT::integer(getVectorIdxWidth(DL));
}

/// Returns the type to be used for the EVL/AVL operand of VP nodes:
Expand Down
Loading