Skip to content

Commit 5107a47

Browse files
authored
Revert "[Clang][RISCV] Introduce tuple types for RVV bfloat16 (#72216)" (#72367)
This reverts commit 8434b0b. #72216 This commit broke the multiple buildbots, looks like the extension in `NUM_PREDEF_TYPE_IDS` might have broken some inheriting usages, causing indeterminate results for the compiler. Investigating the issue now.
1 parent 73f1753 commit 5107a47

File tree

6 files changed

+4
-121
lines changed

6 files changed

+4
-121
lines changed

clang/include/clang/Basic/RISCVVTypes.def

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -452,62 +452,6 @@ RVV_VECTOR_TYPE_FLOAT("__rvv_float64m2x4_t", RvvFloat64m2x4, RvvFloat64m2x4Ty, 2
452452

453453
RVV_VECTOR_TYPE_FLOAT("__rvv_float64m4x2_t", RvvFloat64m4x2, RvvFloat64m4x2Ty, 4, 64, 2)
454454

455-
//===- BFloat16 tuple types -------------------------------------------------===//
456-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x2_t", RvvBFloat16mf4x2, RvvBFloat16mf4x2Ty,
457-
1, 16, 2)
458-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x3_t", RvvBFloat16mf4x3, RvvBFloat16mf4x3Ty,
459-
1, 16, 3)
460-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x4_t", RvvBFloat16mf4x4, RvvBFloat16mf4x4Ty,
461-
1, 16, 4)
462-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x5_t", RvvBFloat16mf4x5, RvvBFloat16mf4x5Ty,
463-
1, 16, 5)
464-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x6_t", RvvBFloat16mf4x6, RvvBFloat16mf4x6Ty,
465-
1, 16, 6)
466-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x7_t", RvvBFloat16mf4x7, RvvBFloat16mf4x7Ty,
467-
1, 16, 7)
468-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf4x8_t", RvvBFloat16mf4x8, RvvBFloat16mf4x8Ty,
469-
1, 16, 8)
470-
471-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x2_t", RvvBFloat16mf2x2, RvvBFloat16mf2x2Ty,
472-
2, 16, 2)
473-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x3_t", RvvBFloat16mf2x3, RvvBFloat16mf2x3Ty,
474-
2, 16, 3)
475-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x4_t", RvvBFloat16mf2x4, RvvBFloat16mf2x4Ty,
476-
2, 16, 4)
477-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x5_t", RvvBFloat16mf2x5, RvvBFloat16mf2x5Ty,
478-
2, 16, 5)
479-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x6_t", RvvBFloat16mf2x6, RvvBFloat16mf2x6Ty,
480-
2, 16, 6)
481-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x7_t", RvvBFloat16mf2x7, RvvBFloat16mf2x7Ty,
482-
2, 16, 7)
483-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16mf2x8_t", RvvBFloat16mf2x8, RvvBFloat16mf2x8Ty,
484-
2, 16, 8)
485-
486-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x2_t", RvvBFloat16m1x2, RvvBFloat16m1x2Ty,
487-
4, 16, 2)
488-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x3_t", RvvBFloat16m1x3, RvvBFloat16m1x3Ty,
489-
4, 16, 3)
490-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x4_t", RvvBFloat16m1x4, RvvBFloat16m1x4Ty,
491-
4, 16, 4)
492-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x5_t", RvvBFloat16m1x5, RvvBFloat16m1x5Ty,
493-
4, 16, 5)
494-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x6_t", RvvBFloat16m1x6, RvvBFloat16m1x6Ty,
495-
4, 16, 6)
496-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x7_t", RvvBFloat16m1x7, RvvBFloat16m1x7Ty,
497-
4, 16, 7)
498-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m1x8_t", RvvBFloat16m1x8, RvvBFloat16m1x8Ty,
499-
4, 16, 8)
500-
501-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x2_t", RvvBFloat16m2x2, RvvBFloat16m2x2Ty,
502-
8, 16, 2)
503-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x3_t", RvvBFloat16m2x3, RvvBFloat16m2x3Ty,
504-
8, 16, 3)
505-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m2x4_t", RvvBFloat16m2x4, RvvBFloat16m2x4Ty,
506-
8, 16, 4)
507-
508-
RVV_VECTOR_TYPE_BFLOAT("__rvv_bfloat16m4x2_t", RvvBFloat16m4x2, RvvBFloat16m4x2Ty,
509-
16, 16, 2)
510-
511455
#undef RVV_VECTOR_TYPE_BFLOAT
512456
#undef RVV_VECTOR_TYPE_FLOAT
513457
#undef RVV_VECTOR_TYPE_INT

clang/include/clang/Serialization/ASTBitCodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ enum PredefinedTypeIDs {
11011101
///
11021102
/// Type IDs for non-predefined types will start at
11031103
/// NUM_PREDEF_TYPE_IDs.
1104-
const unsigned NUM_PREDEF_TYPE_IDS = 600;
1104+
const unsigned NUM_PREDEF_TYPE_IDS = 500;
11051105

11061106
// Ensure we do not overrun the predefined types we reserved
11071107
// in the enum PredefinedTypeIDs above.

clang/include/clang/Support/RISCVVIntrinsicUtils.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,13 @@ enum class TypeModifier : uint8_t {
9797
UnsignedInteger = 1 << 3,
9898
SignedInteger = 1 << 4,
9999
Float = 1 << 5,
100-
BFloat = 1 << 6,
101100
// LMUL1 should be kind of VectorTypeModifier, but that might come with
102101
// Widening2XVector for widening reduction.
103102
// However that might require VectorTypeModifier become bitmask rather than
104103
// simple enum, so we decide keek LMUL1 in TypeModifier for code size
105104
// optimization of clang binary size.
106-
LMUL1 = 1 << 7,
107-
MaxOffset = 7,
105+
LMUL1 = 1 << 6,
106+
MaxOffset = 6,
108107
LLVM_MARK_AS_BITMASK_ENUM(LMUL1),
109108
};
110109

clang/lib/Support/RISCVVIntrinsicUtils.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,6 @@ void RVVType::applyModifier(const PrototypeDescriptor &Transformer) {
857857
case TypeModifier::Float:
858858
ScalarType = ScalarTypeKind::Float;
859859
break;
860-
case TypeModifier::BFloat:
861-
ScalarType = ScalarTypeKind::BFloat;
862-
break;
863860
case TypeModifier::LMUL1:
864861
LMUL = LMULType(0);
865862
// Update ElementBitwidth need to update Scale too.

clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/rvv-intrinsic-datatypes.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -305,31 +305,6 @@
305305
// CHECK-NEXT: [[F64M2X3:%.*]] = alloca { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }, align 8
306306
// CHECK-NEXT: [[F64M2X4:%.*]] = alloca { <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double> }, align 8
307307
// CHECK-NEXT: [[F64M4X2:%.*]] = alloca { <vscale x 4 x double>, <vscale x 4 x double> }, align 8
308-
// CHECK-NEXT: [[BF16MF4X2:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
309-
// CHECK-NEXT: [[BF16MF4X3:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
310-
// CHECK-NEXT: [[BF16MF4X4:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
311-
// CHECK-NEXT: [[BF16MF4X5:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
312-
// CHECK-NEXT: [[BF16MF4X6:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
313-
// CHECK-NEXT: [[BF16MF4X7:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
314-
// CHECK-NEXT: [[BF16MF4X8:%.*]] = alloca { <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat>, <vscale x 1 x bfloat> }, align 2
315-
// CHECK-NEXT: [[BF16MF2X2:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
316-
// CHECK-NEXT: [[BF16MF2X3:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
317-
// CHECK-NEXT: [[BF16MF2X4:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
318-
// CHECK-NEXT: [[BF16MF2X5:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
319-
// CHECK-NEXT: [[BF16MF2X6:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
320-
// CHECK-NEXT: [[BF16MF2X7:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
321-
// CHECK-NEXT: [[BF16MF2X8:%.*]] = alloca { <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat>, <vscale x 2 x bfloat> }, align 2
322-
// CHECK-NEXT: [[BF16M1X2:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
323-
// CHECK-NEXT: [[BF16M1X3:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
324-
// CHECK-NEXT: [[BF16M1X4:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
325-
// CHECK-NEXT: [[BF16M1X5:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
326-
// CHECK-NEXT: [[BF16M1X6:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
327-
// CHECK-NEXT: [[BF16M1X7:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
328-
// CHECK-NEXT: [[BF16M1X8:%.*]] = alloca { <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat>, <vscale x 4 x bfloat> }, align 2
329-
// CHECK-NEXT: [[BF16M2X2:%.*]] = alloca { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> }, align 2
330-
// CHECK-NEXT: [[BF16M2X3:%.*]] = alloca { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> }, align 2
331-
// CHECK-NEXT: [[BF16M2X4:%.*]] = alloca { <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat> }, align 2
332-
// CHECK-NEXT: [[BF16M4X2:%.*]] = alloca { <vscale x 16 x bfloat>, <vscale x 16 x bfloat> }, align 2
333308
// CHECK-NEXT: ret void
334309
//
335310
void foo () {
@@ -689,34 +664,4 @@ void foo () {
689664
vfloat64m2x4_t f64m2x4;
690665

691666
vfloat64m4x2_t f64m4x2;
692-
// bf16
693-
vbfloat16mf4x2_t bf16mf4x2;
694-
vbfloat16mf4x3_t bf16mf4x3;
695-
vbfloat16mf4x4_t bf16mf4x4;
696-
vbfloat16mf4x5_t bf16mf4x5;
697-
vbfloat16mf4x6_t bf16mf4x6;
698-
vbfloat16mf4x7_t bf16mf4x7;
699-
vbfloat16mf4x8_t bf16mf4x8;
700-
701-
vbfloat16mf2x2_t bf16mf2x2;
702-
vbfloat16mf2x3_t bf16mf2x3;
703-
vbfloat16mf2x4_t bf16mf2x4;
704-
vbfloat16mf2x5_t bf16mf2x5;
705-
vbfloat16mf2x6_t bf16mf2x6;
706-
vbfloat16mf2x7_t bf16mf2x7;
707-
vbfloat16mf2x8_t bf16mf2x8;
708-
709-
vbfloat16m1x2_t bf16m1x2;
710-
vbfloat16m1x3_t bf16m1x3;
711-
vbfloat16m1x4_t bf16m1x4;
712-
vbfloat16m1x5_t bf16m1x5;
713-
vbfloat16m1x6_t bf16m1x6;
714-
vbfloat16m1x7_t bf16m1x7;
715-
vbfloat16m1x8_t bf16m1x8;
716-
717-
vbfloat16m2x2_t bf16m2x2;
718-
vbfloat16m2x3_t bf16m2x3;
719-
vbfloat16m2x4_t bf16m2x4;
720-
721-
vbfloat16m4x2_t bf16m4x2;
722667
}

clang/utils/TableGen/RISCVVEmitter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
401401
auto TupleT = TypeCache.computeType(
402402
BT, Log2LMUL,
403403
PrototypeDescriptor(BaseTypeModifier::Vector, getTupleVTM(NF),
404-
(BT == BasicType::BFloat16
405-
? TypeModifier::BFloat
406-
: TypeModifier::Float)));
404+
TypeModifier::Float));
407405
if (TupleT)
408406
printType(*TupleT);
409407
}

0 commit comments

Comments
 (0)