Skip to content

Commit 7794e16

Browse files
committed
[AMDGPU]: Allow combining into v_dot4
Differential Revision: https://reviews.llvm.org/D155995 Change-Id: Id15d232629a32a3549b13d47bf84d7a61b28b928
1 parent 3b0b84f commit 7794e16

File tree

5 files changed

+5433
-383
lines changed

5 files changed

+5433
-383
lines changed

llvm/include/llvm/CodeGen/ByteProvider.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ template <typename ISelOp> class ByteProvider {
3232
ByteProvider(std::optional<ISelOp> Src, int64_t DestOffset, int64_t SrcOffset)
3333
: Src(Src), DestOffset(DestOffset), SrcOffset(SrcOffset) {}
3434

35+
ByteProvider(std::optional<ISelOp> Src, int64_t DestOffset, int64_t SrcOffset,
36+
std::optional<bool> IsSigned)
37+
: Src(Src), DestOffset(DestOffset), SrcOffset(SrcOffset),
38+
IsSigned(IsSigned) {}
39+
3540
// TODO -- use constraint in c++20
3641
// Does this type correspond with an operation in selection DAG
3742
template <typename T> class is_op {
@@ -61,6 +66,9 @@ template <typename ISelOp> class ByteProvider {
6166
// DestOffset
6267
int64_t SrcOffset = 0;
6368

69+
// Whether or not the path to this Src involved signed extensions
70+
std::optional<bool> IsSigned;
71+
6472
ByteProvider() = default;
6573

6674
static ByteProvider getSrc(std::optional<ISelOp> Val, int64_t ByteOffset,
@@ -70,6 +78,14 @@ template <typename ISelOp> class ByteProvider {
7078
return ByteProvider(Val, ByteOffset, VectorOffset);
7179
}
7280

81+
static ByteProvider getSrc(std::optional<ISelOp> Val, int64_t ByteOffset,
82+
int64_t VectorOffset,
83+
std::optional<bool> IsSigned) {
84+
static_assert(is_op<ISelOp>().value,
85+
"ByteProviders must contain an operation in selection DAG.");
86+
return ByteProvider(Val, ByteOffset, VectorOffset, IsSigned);
87+
}
88+
7389
static ByteProvider getConstantZero() {
7490
return ByteProvider<ISelOp>(std::nullopt, 0, 0);
7591
}

0 commit comments

Comments
 (0)