File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,6 @@ IntegerType IntegerType::scaleElementBitwidth(unsigned scale) {
9191// ===----------------------------------------------------------------------===//
9292
9393unsigned FloatType::getWidth () {
94- // The actual width of TF32 is 19 bits. However, since it is a truncated
95- // version of Float32, we treat it as 32 bits in MLIR FloatType::getWidth
96- // for compatibility.
97- if (llvm::isa<FloatTF32Type>(*this ))
98- return 32 ;
9994 return APFloat::semanticsSizeInBits (getFloatSemantics ());
10095}
10196
Original file line number Diff line number Diff line change @@ -561,6 +561,14 @@ func.func @correct_type_pass() {
561561
562562// -----
563563
564+ func.func @tf32_elements_attr () {
565+ // CHECK: "foo"() {attr = dense<4.000000e+00> : tensor<tf32>} : () -> ()
566+ " foo" () {attr = dense <4.0 > : tensor <tf32 >} : () -> ()
567+ return
568+ }
569+
570+ // -----
571+
564572//===----------------------------------------------------------------------===//
565573// Test StringElementsAttr
566574//===----------------------------------------------------------------------===//
@@ -675,6 +683,14 @@ func.func @dense_array_attr() attributes {
675683
676684// -----
677685
686+ func.func @test_invalid_bitwidth_type () {
687+ // expected-error @below{{element type bitwidth must be a multiple of 8}}
688+ " foo" () {tf32attr = array<tf32 : 1024.0 >} : () -> ()
689+ return
690+ }
691+
692+ // -----
693+
678694func.func @testConfinedDenseArrayAttr () {
679695 " test.confined_dense_array_attr" () {
680696 i64attr = array <i64 : 0 , 2 , 3 >,
You can’t perform that action at this time.
0 commit comments