-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebAssembly] Update generic and bleeding-edge CPUs #96584
Conversation
This updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match https://github.com/llvm/llvm-project/blob/4e0a0eae58f7a6998866719f7eb970096a2a52e9/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L175. It is hard to add a backend test for this, given that we don't have a convenient way of testing the list of features included in each cpu like the preprocessor test in Clang: https://github.com/llvm/llvm-project/blob/4e0a0eae58f7a6998866719f7eb970096a2a52e9/clang/test/Preprocessor/wasm-target-features.c#L158-L208 And the current features for 'generic' and 'bleeding-edge' don't have a separate backend test anyway.
@llvm/pr-subscribers-mc @llvm/pr-subscribers-backend-webassembly Author: Heejin Ahn (aheejin) ChangesThis updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp Lines 150 to 175 in 4e0a0ea
It is hard to add a backend test for this, given that we don't have a convenient way of testing the list of features included in each cpu like the preprocessor test in Clang: llvm-project/clang/test/Preprocessor/wasm-target-features.c Lines 158 to 208 in 4e0a0ea
Full diff: https://github.com/llvm/llvm-project/pull/96584.diff 1 Files Affected:
diff --git a/llvm/lib/Target/WebAssembly/WebAssembly.td b/llvm/lib/Target/WebAssembly/WebAssembly.td
index 0dd674426e9e8..97618617ff82f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssembly.td
+++ b/llvm/lib/Target/WebAssembly/WebAssembly.td
@@ -110,13 +110,17 @@ def : ProcessorModel<"mvp", NoSchedModel, []>;
// consideration given to available support in relevant engines and tools, and
// the importance of the features.
def : ProcessorModel<"generic", NoSchedModel,
- [FeatureSignExt, FeatureMutableGlobals]>;
+ [FeatureMultivalue, FeatureMutableGlobals,
+ FeatureReferenceTypes, FeatureSignExt]>;
// Latest and greatest experimental version of WebAssembly. Bugs included!
def : ProcessorModel<"bleeding-edge", NoSchedModel,
- [FeatureSIMD128, FeatureAtomics,
- FeatureNontrappingFPToInt, FeatureSignExt,
- FeatureMutableGlobals, FeatureBulkMemory,
+ [FeatureAtomics, FeatureBulkMemory,
+ FeatureExceptionHandling, FeatureExtendedConst,
+ FeatureHalfPrecision, FeatureMultiMemory,
+ FeatureMultivalue, FeatureMutableGlobals,
+ FeatureNontrappingFPToInt, FeatureRelaxedSIMD,
+ FeatureReferenceTypes, FeatureSIMD128, FeatureSignExt,
FeatureTailCall]>;
//===----------------------------------------------------------------------===//
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sorry, apparently there are tests to be updated 😅 3186ad7 updates tests in a way that, if a test has separate Also, when tests is not really about reference-types but they have to updated because they happen to contain I think https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/WebAssembly/target-features.ll better be updated separately... Will upload a PR for that and land this after that one lands. |
Test changes so far look good 👍 |
Will land this; please let me know if you have any other comments. |
This updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match https://github.com/llvm/llvm-project/blob/4e0a0eae58f7a6998866719f7eb970096a2a52e9/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L178 This updates existing CodeGen tests in a way that, if a test has separate RUN lines for a reference-types test and a non-reference-types test, I added -mattr=-reference-types to the no-reftype test's RUN command line. I didn't delete existing -mattr=+reference-types lines in reftype tests because having it helps readability. Also, when tests is not really about reference-types but they have to updated because they happen to contain call_indirect lines because now call_indirect will take __indirect_function_table as an argument, I just added the table argument to the expected output. `target-features-cpus.ll` has been updated reflecting the newly added features.
This updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match https://github.com/llvm/llvm-project/blob/4e0a0eae58f7a6998866719f7eb970096a2a52e9/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L178 This updates existing CodeGen tests in a way that, if a test has separate RUN lines for a reference-types test and a non-reference-types test, I added -mattr=-reference-types to the no-reftype test's RUN command line. I didn't delete existing -mattr=+reference-types lines in reftype tests because having it helps readability. Also, when tests is not really about reference-types but they have to updated because they happen to contain call_indirect lines because now call_indirect will take __indirect_function_table as an argument, I just added the table argument to the expected output. `target-features-cpus.ll` has been updated reflecting the newly added features.
Some feedback: This broke the majority of the JavaScript bundlers (webpack and co.) which are commonly built on top of |
Can you say more about what the bundlers are doing, and how they are doing it? |
Interestingly, it looks like the decoder in webassemblyjs already decodes the table index as an LEB. |
actually... sorry, let's have this conversation on WebAssembly/tool-conventions#233 rather than forking it here. |
This updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match
llvm-project/clang/lib/Basic/Targets/WebAssembly.cpp
Lines 150 to 178 in 4e0a0ea
This updates existing CodeGen tests in a way that, if a test has separate RUN lines for a reference-types test and a non-reference-types test, I added -mattr=-reference-types to the no-reftype test's RUN command line. I didn't delete existing -mattr=+reference-types lines in reftype tests because having it helps readability.
Also, when tests is not really about reference-types but they have to updated because they happen to contain call_indirect lines because now call_indirect will take __indirect_function_table as an argument, I just added the table argument to the expected output.
target-features-cpus.ll
has been updated reflecting the newly added features.