[PATCH] D138274: Add version to all LLVM cmake package

2022-11-19 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident accepted this revision.
stellaraccident added a comment.

As mentioned, the duplication is annoying but I suspect is the least bad way to 
do it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138274/new/

https://reviews.llvm.org/D138274

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D137760: Add FP8 E4M3 support to APFloat.

2022-11-15 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident accepted this revision.
stellaraccident added a comment.

Thanks for this. Patch lgtm. Has a couple of format issues but probably ok 
as-is (this file is very inconsistently formatted and it looks like you 
overrode clang-format a bit for consistency with adjacent code).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137760/new/

https://reviews.llvm.org/D137760

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D133823: Add APFloat and MLIR type support for fp8 (e5m2).

2022-10-04 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident added a comment.

Ran the full clang/llvm/mlir test suite in debug mode just to be safe.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133823/new/

https://reviews.llvm.org/D133823

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D133823: Add APFloat and MLIR type support for fp8 (e5m2).

2022-10-04 Thread Stella Laurenzo via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe28b15b572b5: Add APFloat and MLIR type support for fp8 
(e5m2). (authored by stellaraccident).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133823/new/

https://reviews.llvm.org/D133823

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp
  mlir/include/mlir-c/BuiltinTypes.h
  mlir/include/mlir/IR/Builders.h
  mlir/include/mlir/IR/BuiltinTypes.h
  mlir/include/mlir/IR/BuiltinTypes.td
  mlir/include/mlir/IR/Types.h
  mlir/lib/AsmParser/TokenKinds.def
  mlir/lib/AsmParser/TypeParser.cpp
  mlir/lib/CAPI/IR/BuiltinTypes.cpp
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/IR/Builders.cpp
  mlir/lib/IR/BuiltinTypes.cpp
  mlir/lib/IR/MLIRContext.cpp
  mlir/lib/IR/Types.cpp
  mlir/test/IR/attribute.mlir
  mlir/test/lib/Dialect/Test/TestOps.td

Index: mlir/test/lib/Dialect/Test/TestOps.td
===
--- mlir/test/lib/Dialect/Test/TestOps.td
+++ mlir/test/lib/Dialect/Test/TestOps.td
@@ -193,6 +193,14 @@
   let assemblyFormat = "$attr attr-dict";
 }
 
+def FloatAttrOp : TEST_Op<"float_attrs"> {
+  // TODO: Clean up the OpBase float type and attribute selectors so they
+  // can express all of the types.
+  let arguments = (ins
+AnyAttr:$float_attr
+  );
+}
+
 def I32Case5:  I32EnumAttrCase<"case5", 5>;
 def I32Case10: I32EnumAttrCase<"case10", 10>;
 
Index: mlir/test/IR/attribute.mlir
===
--- mlir/test/IR/attribute.mlir
+++ mlir/test/IR/attribute.mlir
@@ -31,6 +31,42 @@
 
 // -
 
+//===--===//
+// Test float attributes
+//===--===//
+
+func.func @float_attrs_pass() {
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f8E5M2
+float_attr = 2. : f8E5M2
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f16
+float_attr = 2. : f16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : bf16
+float_attr = 2. : bf16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f32
+float_attr = 2. : f32
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f64
+float_attr = 2. : f64
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f80
+float_attr = 2. : f80
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f128
+float_attr = 2. : f128
+  } : () -> ()
+  return
+}
+
 //===--===//
 // Test integer attributes
 //===--===//
Index: mlir/lib/IR/Types.cpp
===
--- mlir/lib/IR/Types.cpp
+++ mlir/lib/IR/Types.cpp
@@ -18,6 +18,7 @@
 
 MLIRContext *Type::getContext() const { return getDialect().getContext(); }
 
+bool Type::isFloat8E5M2() const { return isa(); }
 bool Type::isBF16() const { return isa(); }
 bool Type::isF16() const { return isa(); }
 bool Type::isF32() const { return isa(); }
Index: mlir/lib/IR/MLIRContext.cpp
===
--- mlir/lib/IR/MLIRContext.cpp
+++ mlir/lib/IR/MLIRContext.cpp
@@ -206,6 +206,7 @@
   StorageUniquer typeUniquer;
 
   /// Cached Type Instances.
+  Float8E5M2Type f8E5M2Ty;
   BFloat16Type bf16Ty;
   Float16Type f16Ty;
   Float32Type f32Ty;
@@ -276,6 +277,7 @@
 
    Types.
   /// Floating-point Types.
+  impl->f8E5M2Ty = TypeUniquer::get(this);
   impl->bf16Ty = TypeUniquer::get(this);
   impl->f16Ty = TypeUniquer::get(this);
   impl->f32Ty = TypeUniquer::get(this);
@@ -840,6 +842,9 @@
 /// This should not be used directly.
 StorageUniquer ::getTypeUniquer() { return getImpl().typeUniquer; }
 
+Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) {
+  return context->getImpl().f8E5M2Ty;
+}
 BFloat16Type BFloat16Type::get(MLIRContext *context) {
   return context->getImpl().bf16Ty;
 }
Index: mlir/lib/IR/BuiltinTypes.cpp
===
--- mlir/lib/IR/BuiltinTypes.cpp
+++ mlir/lib/IR/BuiltinTypes.cpp
@@ -88,6 +88,8 @@
 //===--===//
 
 unsigned FloatType::getWidth() {
+  if (isa())
+return 8;
   if (isa())
 return 16;
   if (isa())
@@ -103,6 +105,8 @@
 
 /// Returns the floating semantics for the given type.
 const llvm::fltSemantics ::getFloatSemantics() {
+  if (isa())
+return APFloat::Float8E5M2();
   if (isa())
 return 

[PATCH] D133823: Add APFloat and MLIR type support for fp8 (e5m2).

2022-10-04 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident updated this revision to Diff 465233.
stellaraccident marked an inline comment as done.
stellaraccident added a comment.

Remove break after llvm_unreachable for consistency with other switches in file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133823/new/

https://reviews.llvm.org/D133823

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp
  mlir/include/mlir-c/BuiltinTypes.h
  mlir/include/mlir/IR/Builders.h
  mlir/include/mlir/IR/BuiltinTypes.h
  mlir/include/mlir/IR/BuiltinTypes.td
  mlir/include/mlir/IR/Types.h
  mlir/lib/AsmParser/TokenKinds.def
  mlir/lib/AsmParser/TypeParser.cpp
  mlir/lib/CAPI/IR/BuiltinTypes.cpp
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/IR/Builders.cpp
  mlir/lib/IR/BuiltinTypes.cpp
  mlir/lib/IR/MLIRContext.cpp
  mlir/lib/IR/Types.cpp
  mlir/test/IR/attribute.mlir
  mlir/test/lib/Dialect/Test/TestOps.td

Index: mlir/test/lib/Dialect/Test/TestOps.td
===
--- mlir/test/lib/Dialect/Test/TestOps.td
+++ mlir/test/lib/Dialect/Test/TestOps.td
@@ -193,6 +193,14 @@
   let assemblyFormat = "$attr attr-dict";
 }
 
+def FloatAttrOp : TEST_Op<"float_attrs"> {
+  // TODO: Clean up the OpBase float type and attribute selectors so they
+  // can express all of the types.
+  let arguments = (ins
+AnyAttr:$float_attr
+  );
+}
+
 def I32Case5:  I32EnumAttrCase<"case5", 5>;
 def I32Case10: I32EnumAttrCase<"case10", 10>;
 
Index: mlir/test/IR/attribute.mlir
===
--- mlir/test/IR/attribute.mlir
+++ mlir/test/IR/attribute.mlir
@@ -31,6 +31,42 @@
 
 // -
 
+//===--===//
+// Test float attributes
+//===--===//
+
+func.func @float_attrs_pass() {
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f8E5M2
+float_attr = 2. : f8E5M2
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f16
+float_attr = 2. : f16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : bf16
+float_attr = 2. : bf16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f32
+float_attr = 2. : f32
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f64
+float_attr = 2. : f64
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f80
+float_attr = 2. : f80
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f128
+float_attr = 2. : f128
+  } : () -> ()
+  return
+}
+
 //===--===//
 // Test integer attributes
 //===--===//
Index: mlir/lib/IR/Types.cpp
===
--- mlir/lib/IR/Types.cpp
+++ mlir/lib/IR/Types.cpp
@@ -18,6 +18,7 @@
 
 MLIRContext *Type::getContext() const { return getDialect().getContext(); }
 
+bool Type::isFloat8E5M2() const { return isa(); }
 bool Type::isBF16() const { return isa(); }
 bool Type::isF16() const { return isa(); }
 bool Type::isF32() const { return isa(); }
Index: mlir/lib/IR/MLIRContext.cpp
===
--- mlir/lib/IR/MLIRContext.cpp
+++ mlir/lib/IR/MLIRContext.cpp
@@ -206,6 +206,7 @@
   StorageUniquer typeUniquer;
 
   /// Cached Type Instances.
+  Float8E5M2Type f8E5M2Ty;
   BFloat16Type bf16Ty;
   Float16Type f16Ty;
   Float32Type f32Ty;
@@ -276,6 +277,7 @@
 
    Types.
   /// Floating-point Types.
+  impl->f8E5M2Ty = TypeUniquer::get(this);
   impl->bf16Ty = TypeUniquer::get(this);
   impl->f16Ty = TypeUniquer::get(this);
   impl->f32Ty = TypeUniquer::get(this);
@@ -840,6 +842,9 @@
 /// This should not be used directly.
 StorageUniquer ::getTypeUniquer() { return getImpl().typeUniquer; }
 
+Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) {
+  return context->getImpl().f8E5M2Ty;
+}
 BFloat16Type BFloat16Type::get(MLIRContext *context) {
   return context->getImpl().bf16Ty;
 }
Index: mlir/lib/IR/BuiltinTypes.cpp
===
--- mlir/lib/IR/BuiltinTypes.cpp
+++ mlir/lib/IR/BuiltinTypes.cpp
@@ -88,6 +88,8 @@
 //===--===//
 
 unsigned FloatType::getWidth() {
+  if (isa())
+return 8;
   if (isa())
 return 16;
   if (isa())
@@ -103,6 +105,8 @@
 
 /// Returns the floating semantics for the given type.
 const llvm::fltSemantics ::getFloatSemantics() {
+  if (isa())
+return APFloat::Float8E5M2();
   if (isa())
 return APFloat::BFloat();
   if (isa())
Index: 

[PATCH] D133823: Add APFloat and MLIR type support for fp8 (e5m2).

2022-10-04 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident updated this revision to Diff 465231.
stellaraccident added a comment.

Switch to explicit case per comment from ctopper.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133823/new/

https://reviews.llvm.org/D133823

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp
  mlir/include/mlir-c/BuiltinTypes.h
  mlir/include/mlir/IR/Builders.h
  mlir/include/mlir/IR/BuiltinTypes.h
  mlir/include/mlir/IR/BuiltinTypes.td
  mlir/include/mlir/IR/Types.h
  mlir/lib/AsmParser/TokenKinds.def
  mlir/lib/AsmParser/TypeParser.cpp
  mlir/lib/CAPI/IR/BuiltinTypes.cpp
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/IR/Builders.cpp
  mlir/lib/IR/BuiltinTypes.cpp
  mlir/lib/IR/MLIRContext.cpp
  mlir/lib/IR/Types.cpp
  mlir/test/IR/attribute.mlir
  mlir/test/lib/Dialect/Test/TestOps.td

Index: mlir/test/lib/Dialect/Test/TestOps.td
===
--- mlir/test/lib/Dialect/Test/TestOps.td
+++ mlir/test/lib/Dialect/Test/TestOps.td
@@ -193,6 +193,14 @@
   let assemblyFormat = "$attr attr-dict";
 }
 
+def FloatAttrOp : TEST_Op<"float_attrs"> {
+  // TODO: Clean up the OpBase float type and attribute selectors so they
+  // can express all of the types.
+  let arguments = (ins
+AnyAttr:$float_attr
+  );
+}
+
 def I32Case5:  I32EnumAttrCase<"case5", 5>;
 def I32Case10: I32EnumAttrCase<"case10", 10>;
 
Index: mlir/test/IR/attribute.mlir
===
--- mlir/test/IR/attribute.mlir
+++ mlir/test/IR/attribute.mlir
@@ -31,6 +31,42 @@
 
 // -
 
+//===--===//
+// Test float attributes
+//===--===//
+
+func.func @float_attrs_pass() {
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f8E5M2
+float_attr = 2. : f8E5M2
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f16
+float_attr = 2. : f16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : bf16
+float_attr = 2. : bf16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f32
+float_attr = 2. : f32
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f64
+float_attr = 2. : f64
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f80
+float_attr = 2. : f80
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f128
+float_attr = 2. : f128
+  } : () -> ()
+  return
+}
+
 //===--===//
 // Test integer attributes
 //===--===//
Index: mlir/lib/IR/Types.cpp
===
--- mlir/lib/IR/Types.cpp
+++ mlir/lib/IR/Types.cpp
@@ -18,6 +18,7 @@
 
 MLIRContext *Type::getContext() const { return getDialect().getContext(); }
 
+bool Type::isFloat8E5M2() const { return isa(); }
 bool Type::isBF16() const { return isa(); }
 bool Type::isF16() const { return isa(); }
 bool Type::isF32() const { return isa(); }
Index: mlir/lib/IR/MLIRContext.cpp
===
--- mlir/lib/IR/MLIRContext.cpp
+++ mlir/lib/IR/MLIRContext.cpp
@@ -206,6 +206,7 @@
   StorageUniquer typeUniquer;
 
   /// Cached Type Instances.
+  Float8E5M2Type f8E5M2Ty;
   BFloat16Type bf16Ty;
   Float16Type f16Ty;
   Float32Type f32Ty;
@@ -276,6 +277,7 @@
 
    Types.
   /// Floating-point Types.
+  impl->f8E5M2Ty = TypeUniquer::get(this);
   impl->bf16Ty = TypeUniquer::get(this);
   impl->f16Ty = TypeUniquer::get(this);
   impl->f32Ty = TypeUniquer::get(this);
@@ -840,6 +842,9 @@
 /// This should not be used directly.
 StorageUniquer ::getTypeUniquer() { return getImpl().typeUniquer; }
 
+Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) {
+  return context->getImpl().f8E5M2Ty;
+}
 BFloat16Type BFloat16Type::get(MLIRContext *context) {
   return context->getImpl().bf16Ty;
 }
Index: mlir/lib/IR/BuiltinTypes.cpp
===
--- mlir/lib/IR/BuiltinTypes.cpp
+++ mlir/lib/IR/BuiltinTypes.cpp
@@ -88,6 +88,8 @@
 //===--===//
 
 unsigned FloatType::getWidth() {
+  if (isa())
+return 8;
   if (isa())
 return 16;
   if (isa())
@@ -103,6 +105,8 @@
 
 /// Returns the floating semantics for the given type.
 const llvm::fltSemantics ::getFloatSemantics() {
+  if (isa())
+return APFloat::Float8E5M2();
   if (isa())
 return APFloat::BFloat();
   if (isa())
Index: mlir/lib/IR/Builders.cpp

[PATCH] D133823: Add APFloat and MLIR type support for fp8 (e5m2).

2022-10-04 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident updated this revision to Diff 465230.
stellaraccident added a comment.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Add fix to MicrosoftMangle.cpp that caused buildbot failure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133823/new/

https://reviews.llvm.org/D133823

Files:
  clang/lib/AST/MicrosoftMangle.cpp
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Support/APFloat.cpp
  llvm/unittests/ADT/APFloatTest.cpp
  mlir/include/mlir-c/BuiltinTypes.h
  mlir/include/mlir/IR/Builders.h
  mlir/include/mlir/IR/BuiltinTypes.h
  mlir/include/mlir/IR/BuiltinTypes.td
  mlir/include/mlir/IR/Types.h
  mlir/lib/AsmParser/TokenKinds.def
  mlir/lib/AsmParser/TypeParser.cpp
  mlir/lib/CAPI/IR/BuiltinTypes.cpp
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/IR/Builders.cpp
  mlir/lib/IR/BuiltinTypes.cpp
  mlir/lib/IR/MLIRContext.cpp
  mlir/lib/IR/Types.cpp
  mlir/test/IR/attribute.mlir
  mlir/test/lib/Dialect/Test/TestOps.td

Index: mlir/test/lib/Dialect/Test/TestOps.td
===
--- mlir/test/lib/Dialect/Test/TestOps.td
+++ mlir/test/lib/Dialect/Test/TestOps.td
@@ -193,6 +193,14 @@
   let assemblyFormat = "$attr attr-dict";
 }
 
+def FloatAttrOp : TEST_Op<"float_attrs"> {
+  // TODO: Clean up the OpBase float type and attribute selectors so they
+  // can express all of the types.
+  let arguments = (ins
+AnyAttr:$float_attr
+  );
+}
+
 def I32Case5:  I32EnumAttrCase<"case5", 5>;
 def I32Case10: I32EnumAttrCase<"case10", 10>;
 
Index: mlir/test/IR/attribute.mlir
===
--- mlir/test/IR/attribute.mlir
+++ mlir/test/IR/attribute.mlir
@@ -31,6 +31,42 @@
 
 // -
 
+//===--===//
+// Test float attributes
+//===--===//
+
+func.func @float_attrs_pass() {
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f8E5M2
+float_attr = 2. : f8E5M2
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f16
+float_attr = 2. : f16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : bf16
+float_attr = 2. : bf16
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f32
+float_attr = 2. : f32
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f64
+float_attr = 2. : f64
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f80
+float_attr = 2. : f80
+  } : () -> ()
+  "test.float_attrs"() {
+// CHECK: float_attr = 2.00e+00 : f128
+float_attr = 2. : f128
+  } : () -> ()
+  return
+}
+
 //===--===//
 // Test integer attributes
 //===--===//
Index: mlir/lib/IR/Types.cpp
===
--- mlir/lib/IR/Types.cpp
+++ mlir/lib/IR/Types.cpp
@@ -18,6 +18,7 @@
 
 MLIRContext *Type::getContext() const { return getDialect().getContext(); }
 
+bool Type::isFloat8E5M2() const { return isa(); }
 bool Type::isBF16() const { return isa(); }
 bool Type::isF16() const { return isa(); }
 bool Type::isF32() const { return isa(); }
Index: mlir/lib/IR/MLIRContext.cpp
===
--- mlir/lib/IR/MLIRContext.cpp
+++ mlir/lib/IR/MLIRContext.cpp
@@ -206,6 +206,7 @@
   StorageUniquer typeUniquer;
 
   /// Cached Type Instances.
+  Float8E5M2Type f8E5M2Ty;
   BFloat16Type bf16Ty;
   Float16Type f16Ty;
   Float32Type f32Ty;
@@ -276,6 +277,7 @@
 
    Types.
   /// Floating-point Types.
+  impl->f8E5M2Ty = TypeUniquer::get(this);
   impl->bf16Ty = TypeUniquer::get(this);
   impl->f16Ty = TypeUniquer::get(this);
   impl->f32Ty = TypeUniquer::get(this);
@@ -840,6 +842,9 @@
 /// This should not be used directly.
 StorageUniquer ::getTypeUniquer() { return getImpl().typeUniquer; }
 
+Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) {
+  return context->getImpl().f8E5M2Ty;
+}
 BFloat16Type BFloat16Type::get(MLIRContext *context) {
   return context->getImpl().bf16Ty;
 }
Index: mlir/lib/IR/BuiltinTypes.cpp
===
--- mlir/lib/IR/BuiltinTypes.cpp
+++ mlir/lib/IR/BuiltinTypes.cpp
@@ -88,6 +88,8 @@
 //===--===//
 
 unsigned FloatType::getWidth() {
+  if (isa())
+return 8;
   if (isa())
 return 16;
   if (isa())
@@ -103,6 +105,8 @@
 
 /// Returns the floating semantics for the given type.
 const llvm::fltSemantics ::getFloatSemantics() {
+  if (isa())
+return APFloat::Float8E5M2();
   if (isa())
 return APFloat::BFloat();
   if (isa())
Index: 

[PATCH] D131919: Move googletest to the third-party directory

2022-08-15 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident accepted this revision.
stellaraccident added inline comments.



Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:1257
+
+set(LLVM_THIRD_PARTY_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/../third-party CACHE 
STRING
+"Directory containing third party software used by LLVM (e.g. googletest)")

tstellar wrote:
> stellaraccident wrote:
> > Is the implication that this file should only ever be included by top-level 
> > sub-projects (i.e. clang, mlir, llvm, etc)? If included from elsewhere, it 
> > seems like it won't do the right thing.
> > 
> > Also, having this as a cache entry is going to make it harder for out of 
> > tree projects to define it reliably (requiring various FORCE heroics) -- 
> > but I know why you are doing it if trying to define it here.
> > 
> > As is, this file is included from most of the top-levels and making it a 
> > cache variable will have them racing to set it. Why not make it a regular 
> > variable? And why not derive it from LLVM_MAIN_SRC_DIR?
> I put it in this file so that this variable would be available for 
> stand-alone builds and made it a cache variable so it could be overridden by 
> standalone builds too.
> 
> The alternative would be to define this variable in llvm/CMakeLists.txt and 
> then in the stand-alone build handling for each sub-project.  It's a lot of 
> code duplication that way, but we already have a lot of similar duplication 
> in the CMakeLists.txt today (this is something I would like to clean up in 
> the future).
> 
> Using LLVM_MAIN_SRC_DIR here breaks stand-alone builds, because 
> LLVM_MAIN_SRC_DIR expands to ../llvm/../, so if I try to build lld, with a 
> directory layout of:
> 
> ```
> lld/ cmake/ third-party/
> ```
> 
> Then CMake won't be able to find the third-party/ directory even though it is 
> in the right place (because llvm/ is missing).  I also think in general, it's 
> cleaner to only use LLVM_MAIN_SRC_DIR when we want to use files in llvm/ and 
> not for finding the root of the monorepo.
Thanks - I think I understand why you are doing it this way. I'm just trying to 
think of a way that has fewer thorns... And not being successful (without major 
surgery on the way this cmake setup is layered). I'm fine with how you have it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131919/new/

https://reviews.llvm.org/D131919

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D131919: Move googletest to the third-party directory

2022-08-15 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident added inline comments.



Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:1257
+
+set(LLVM_THIRD_PARTY_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/../third-party CACHE 
STRING
+"Directory containing third party software used by LLVM (e.g. googletest)")

Is the implication that this file should only ever be included by top-level 
sub-projects (i.e. clang, mlir, llvm, etc)? If included from elsewhere, it 
seems like it won't do the right thing.

Also, having this as a cache entry is going to make it harder for out of tree 
projects to define it reliably (requiring various FORCE heroics) -- but I know 
why you are doing it if trying to define it here.

As is, this file is included from most of the top-levels and making it a cache 
variable will have them racing to set it. Why not make it a regular variable? 
And why not derive it from LLVM_MAIN_SRC_DIR?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131919/new/

https://reviews.llvm.org/D131919

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D84058: Pass -rtlib=libgcc in tests conditioned on the default.

2020-07-17 Thread Stella Laurenzo via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5d06e8b24f97: Pass -rtlib=libgcc in tests conditioned on the 
default. (authored by stellaraccident).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84058/new/

https://reviews.llvm.org/D84058

Files:
  clang/test/Driver/msp430-toolchain.c


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-NEG %s < %t
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --gcc-toolchain="%S/Inputs/basic_msp430_tree" --sysroot="" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-DEFAULT-GCC-TOOLCHAIN %s
 // LIBS-DEFAULT-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -112,7 +112,7 @@
 // LIBS-COMPILER-RT-NEG-NOT: crtend.o
 // LIBS-COMPILER-RT-NEG-NOT: /exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -fexceptions \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-fexceptions \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-EXC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-EXC-NEG %s < %t
@@ -126,7 +126,7 @@
 // LIBS-EXC-NEG-NOT: "{{.*}}/430"
 // LIBS-EXC-NEG-NOT: "{{.*}}430/crt{{.*}}"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   -fstack-protector  --sysroot="%S/Inputs/basic_msp430_tree" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-SSP %s
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -138,7 +138,7 @@
 // LIBS-SSP: "-lgcc" "--start-group" "-lmul_none" "-lc" "-lgcc" "-lcrt" 
"-lnosys" "--end-group"
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/430{{/|}}crtend_no_eh.o"
 "-lgcc"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nodefaultlibs \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-NEG %s < %t
@@ -155,7 +155,7 @@
 // LIBS-NO-DFT-NEG-NOT: "--start-group"
 // LIBS-NO-DFT-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nolibc \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nolibc \
 // RUN:   -fstack-protector --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-NEG %s < %t
@@ -173,7 +173,7 @@
 // LIBS-NO-LIBC-NEG-NOT: "--start-group"
 // LIBS-NO-LIBC-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nostartfiles \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-START-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-START-NEG %s < %t
@@ -222,7 +222,7 @@
 // Test for compiling for simulator
 
 // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430g2553 
\
-// RUN:   -msim --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
+// RUN:   -msim -rtlib=libgcc --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
 // RUN: FileCheck -check-prefix=SIMULATOR-POS %s < %t
 // RUN: FileCheck -check-prefix=SIMULATOR-NEG %s < %t
 // SIMULATOR-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-NEG %s < 

[PATCH] D84058: Pass -rtlib=libgcc in tests conditioned on the default.

2020-07-17 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident updated this revision to Diff 278865.
stellaraccident added a comment.

Rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84058/new/

https://reviews.llvm.org/D84058

Files:
  clang/test/Driver/msp430-toolchain.c


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-NEG %s < %t
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --gcc-toolchain="%S/Inputs/basic_msp430_tree" --sysroot="" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-DEFAULT-GCC-TOOLCHAIN %s
 // LIBS-DEFAULT-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -112,7 +112,7 @@
 // LIBS-COMPILER-RT-NEG-NOT: crtend.o
 // LIBS-COMPILER-RT-NEG-NOT: /exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -fexceptions \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-fexceptions \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-EXC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-EXC-NEG %s < %t
@@ -126,7 +126,7 @@
 // LIBS-EXC-NEG-NOT: "{{.*}}/430"
 // LIBS-EXC-NEG-NOT: "{{.*}}430/crt{{.*}}"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   -fstack-protector  --sysroot="%S/Inputs/basic_msp430_tree" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-SSP %s
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -138,7 +138,7 @@
 // LIBS-SSP: "-lgcc" "--start-group" "-lmul_none" "-lc" "-lgcc" "-lcrt" 
"-lnosys" "--end-group"
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/430{{/|}}crtend_no_eh.o"
 "-lgcc"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nodefaultlibs \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-NEG %s < %t
@@ -155,7 +155,7 @@
 // LIBS-NO-DFT-NEG-NOT: "--start-group"
 // LIBS-NO-DFT-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nolibc \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nolibc \
 // RUN:   -fstack-protector --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-NEG %s < %t
@@ -173,7 +173,7 @@
 // LIBS-NO-LIBC-NEG-NOT: "--start-group"
 // LIBS-NO-LIBC-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nostartfiles \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-START-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-START-NEG %s < %t
@@ -222,7 +222,7 @@
 // Test for compiling for simulator
 
 // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430g2553 
\
-// RUN:   -msim --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
+// RUN:   -msim -rtlib=libgcc --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
 // RUN: FileCheck -check-prefix=SIMULATOR-POS %s < %t
 // RUN: FileCheck -check-prefix=SIMULATOR-NEG %s < %t
 // SIMULATOR-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-NEG %s < %t
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### 

[PATCH] D81676: [MSP430] Align the toolchain definition with the TI's msp430-gcc v9.2.0

2020-07-17 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident added a comment.

The msp430-toolchain.c test was failing in our setup, and I've put together a 
fix in D84058 .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81676/new/

https://reviews.llvm.org/D81676



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D84058: Pass -rtlib=libgcc in tests conditioned on the default.

2020-07-17 Thread Stella Laurenzo via Phabricator via cfe-commits
stellaraccident created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

- This test was failing in our builds that configure compiler-rt as the 
configure-time rtlib.
- Opted for this test fix instead of a rollback, and hopefully TI can fix 
forward if this weakens the tests beyond expectations.
- Suspected this failure introduced in D81676 .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84058

Files:
  clang/test/Driver/msp430-toolchain.c


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-DEFAULT-NEG %s < %t
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   --gcc-toolchain="%S/Inputs/basic_msp430_tree" --sysroot="" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-DEFAULT-GCC-TOOLCHAIN %s
 // LIBS-DEFAULT-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -112,7 +112,7 @@
 // LIBS-COMPILER-RT-NEG-NOT: crtend.o
 // LIBS-COMPILER-RT-NEG-NOT: /exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -fexceptions \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-fexceptions \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-EXC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-EXC-NEG %s < %t
@@ -126,7 +126,7 @@
 // LIBS-EXC-NEG-NOT: "{{.*}}/430"
 // LIBS-EXC-NEG-NOT: "{{.*}}430/crt{{.*}}"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN:   -fstack-protector  --sysroot="%S/Inputs/basic_msp430_tree" 2>&1 \
 // RUN:   | FileCheck -check-prefix=LIBS-SSP %s
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"
@@ -138,7 +138,7 @@
 // LIBS-SSP: "-lgcc" "--start-group" "-lmul_none" "-lc" "-lgcc" "-lcrt" 
"-lnosys" "--end-group"
 // LIBS-SSP: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/430{{/|}}crtend_no_eh.o"
 "-lgcc"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nodefaultlibs \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nodefaultlibs \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-DFT-NEG %s < %t
@@ -155,7 +155,7 @@
 // LIBS-NO-DFT-NEG-NOT: "--start-group"
 // LIBS-NO-DFT-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nolibc \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nolibc \
 // RUN:   -fstack-protector --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-LIBC-NEG %s < %t
@@ -173,7 +173,7 @@
 // LIBS-NO-LIBC-NEG-NOT: "--start-group"
 // LIBS-NO-LIBC-NEG-NOT: "--end-group"
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -nostartfiles \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc 
-nostartfiles \
 // RUN:   --sysroot="%S/Inputs/basic_msp430_tree" > %t 2>&1
 // RUN: FileCheck -check-prefix=LIBS-NO-START-POS %s < %t
 // RUN: FileCheck -check-prefix=LIBS-NO-START-NEG %s < %t
@@ -222,7 +222,7 @@
 // Test for compiling for simulator
 
 // RUN: %clang %s -### -no-canonical-prefixes -target msp430 -mmcu=msp430g2553 
\
-// RUN:   -msim --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
+// RUN:   -msim -rtlib=libgcc --sysroot=%S/Inputs/basic_msp430_tree > %t 2>&1
 // RUN: FileCheck -check-prefix=SIMULATOR-POS %s < %t
 // RUN: FileCheck -check-prefix=SIMULATOR-NEG %s < %t
 // SIMULATOR-POS: 
"{{.*}}/Inputs/basic_msp430_tree/lib/gcc/msp430-elf/8.3.1/../../..{{/|}}..{{/|}}bin{{/|}}msp430-elf-ld"


Index: clang/test/Driver/msp430-toolchain.c
===
--- clang/test/Driver/msp430-toolchain.c
+++ clang/test/Driver/msp430-toolchain.c
@@ -66,11 +66,11 @@
 
 // Tests for -nostdlib, -nostartfiles, -nodefaultfiles and -f(no-)exceptions
 
-// RUN: %clang %s -### -no-canonical-prefixes -target msp430 \
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 -rtlib=libgcc \
 // RUN: