[clang] [WebAssembly] Enable multivalue and reference-types in generic CPU config (PR #80923)

Sam Clegg via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 12:37:04 PDT 2024


================
@@ -147,19 +147,25 @@ void WebAssemblyTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
 bool WebAssemblyTargetInfo::initFeatureMap(
     llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
     const std::vector<std::string> &FeaturesVec) const {
-  if (CPU == "bleeding-edge") {
-    Features["nontrapping-fptoint"] = true;
+  auto addGenericFeatures = [&]() {
     Features["sign-ext"] = true;
+    Features["mutable-globals"] = true;
+    Features["reference-types"] = true;
+    Features["multivalue"] = true;
+  };
+  auto addBleedingEdgeFeatures = [&]() {
+    addGenericFeatures();
+    Features["nontrapping-fptoint"] = true;
----------------
sbc100 wrote:

I'm a bit sad not to see this added, since this is the one that can actually improve codegen.   If we know we want to enable to this, is there any downside to doing two different rounds (i.e. are there advantages to waiting on this until we have the lowering pass in place?)

https://github.com/llvm/llvm-project/pull/80923


More information about the cfe-commits mailing list