This patch moves the overall lower-bound arch restriction for Arm XO sections
from v8m to v6m. Actual implementation of code-gen for v6m will follow in
follow-up patches, which will include an implementation of relocations needed to
support this.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
434 ↗ | (On Diff #517898) | V6M does not have Movt. |
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
434 ↗ | (On Diff #517898) | I clarify: there are no test fails with this patch on its own. |
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
434 ↗ | (On Diff #517898) | Correct, this shouldn't be here. Initially it looked like we were going to repurpose movt for v6m, but that should have been part of another patch. And now it looks like we'll handle v6m immediates separately. In any case I'll remove this. |
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
194 ↗ | (On Diff #524755) | What happens in release mode? At the top you now claim that ARMV6M is supported. Could hasV6MOps() silently return false? |
addressed review comment
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
194 ↗ | (On Diff #524755) | This should really be caught by the frontend, but yes, I'm not sure why we use assert so often in this kind of code instead of unreachable. Changed. |
clang/test/Driver/arm-execute-only.c | ||
---|---|---|
1–4 | test/Driver tests should test just the Driver part, not sema/codegen, so we generally use -### to skip compilation. -target has been deprecated since 3.x. Use --target= |
llvm/lib/Target/ARM/ARMSubtarget.cpp | ||
---|---|---|
195 ↗ | (On Diff #525079) | If this code path is actually reachable, a proper error reporting will be better. At the least report_fatal_error can be used. Don't use llvm_unreachable for known-reachable code paths. |
Actual implementation of code-gen for v6m will follow in follow-up patches, which will include an implementation of relocations needed to support this.
Normally we implement the feature in llvm/ first, and the clang/lib/Driver change should be the last patch.
Some users just check whether clang --target=xxx accepts a given option, not test that the feature actually works (it's sometimes non-trivial to figure out all corners as they are not compiler feature implementers.)
clang/test/Driver/arm-execute-only.c | ||
---|---|---|
1–4 | If you don't check -cc1 options with FileCheck, you can also replace -### with -fdriver-only -Werror and drop two -NOT: patterns below. You can play with some examples to see its effect:) If the clang -c -fdriver-only -Werror command gives no output, you can use ... 2>&1 | count 0 |
Yes good point. I won't commit it yet. For this feature we're using Phab as a vehicle to swap patches, so we're reviewing these upstream as they become available.
clang/test/Driver/arm-execute-only.c | ||
---|---|---|
1–4 | Very useful info. Thanks for the tips! |
- Moved the backend parts of this patch to D149443.
- Slightly tweaked the way we call the specific arch in the tests.
Looks great!
clang/test/Driver/arm-execute-only.c | ||
---|---|---|
1–4 | LGTM once the simplification is done (e.g. clang -c -fdriver-only -Werror) |
clang/test/Driver/arm-execute-only.c | ||
---|---|---|
1–4 | yup, thanks for that. I was struggling to get rid of those NOTs. |
test/Driver tests should test just the Driver part, not sema/codegen, so we generally use -### to skip compilation.
-target has been deprecated since 3.x. Use --target=