-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
3-component triple *-none-* is incorrectly normalized to *-none-unknown-* instead of *-unknown-none-* #89582
Comments
Is the title of this ticket correct? The issue is that Vendor=none and OS=unknown when triples for example |
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. Fixes: llvm#89582.
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. libcxx/utils/ci/run-buildbot: Use this new triple. Fixes: llvm#89582.
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. Use this new triple for these tests: - libcxx/utils/ci/run-buildbot - clang/test/Driver/print-multi-selection-flags.c - llvm/unittests/TargetParser/TripleTest.cpp Fixes: llvm#89582.
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. Use this new triple for these tests: - libcxx/utils/ci/run-buildbot - clang/test/Driver/arm-triple.c - clang/test/Driver/print-multi-selection-flags.c - llvm/unittests/TargetParser/TripleTest.cpp Fixes: llvm#89582.
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. Use this new triple for these tests: - clang/docs/Multilib.rst - clang/test/CodeGen/Inputs/linker-diagnostic1.ll - clang/test/CodeGen/linker-diagnostic.ll - clang/test/Driver/arm-ias-Wa.s - clang/test/Driver/arm-triple.c - clang/test/Driver/baremetal-multilib-exclusive-group.yaml - clang/test/Driver/baremetal-multilib-group-error.yaml - clang/test/Driver/baremetal-multilib-layered.yaml - clang/test/Driver/baremetal-multilib.yaml - clang/test/Driver/baremetal-sysroot.cpp - clang/test/Driver/baremetal.cpp - clang/test/Driver/print-multi-selection-flags.c - clang/test/Driver/program-path-priority.c - clang/test/Preprocessor/init-arm.c - clang/unittests/Driver/MultilibTest.cpp - clang/unittests/Interpreter/IncrementalCompilerBuilderTest.cpp - libcxx/utils/ci/run-buildbot - lld/test/ELF/lto/arm.ll - llvm/test/CodeGen/ARM/machine-sink-multidef.mir - llvm/test/CodeGen/ARM/store-prepostinc.mir - llvm/test/CodeGen/ARM/unschedule-reg-sequence.ll - llvm/test/CodeGen/Thumb/consthoist-few-dependents.ll - llvm/test/CodeGen/Thumb/consthoist-imm8-costs-1.ll - llvm/test/CodeGen/Thumb/pr42760.ll - llvm/test/CodeGen/Thumb/smul_fix.ll - llvm/test/CodeGen/Thumb/smul_fix_sat.ll - llvm/test/CodeGen/Thumb/umul_fix.ll - llvm/test/CodeGen/Thumb/umul_fix_sat.ll - llvm/test/CodeGen/Thumb2/LowOverheadLoops/spillingmove.mir - llvm/test/CodeGen/Thumb2/LowOverheadLoops/wls-search-pred.mir - llvm/test/CodeGen/Thumb2/high-reg-spill.mir - llvm/test/CodeGen/Thumb2/mve-pred-constfold.mir - llvm/test/CodeGen/Thumb2/mve-vpt-block-debug.mir - llvm/test/CodeGen/Thumb2/pipeliner-preserve-ties.mir - llvm/test/CodeGen/Thumb2/store-prepostinc.mir - llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll - llvm/test/Transforms/LoopVectorize/ARM/mve-hoist-runtime-checks.ll - llvm/unittests/TargetParser/TripleTest.cpp Fixes: llvm#89582.
If the middle component of a 3-component triple fails to parse as known Arch/Vendor/OS/Env, it will fallback as Vendor. While for some cases, we may wish to recognize it as OS, such as `arm64-none-elf`. In this patch, we will set OS as `none`, if: 1) Arch is found; 2) Env is found; 3) OS is not found and thus is set as empty; 4) Vendor is not found while is set as "none", we will swap Component[2] and Component[3]. Use this new triple for these tests: - clang/docs/Multilib.rst - clang/test/CodeGen/Inputs/linker-diagnostic1.ll - clang/test/CodeGen/linker-diagnostic.ll - clang/test/Driver/arm-ias-Wa.s - clang/test/Driver/arm-triple.c - clang/test/Driver/baremetal-multilib-exclusive-group.yaml - clang/test/Driver/baremetal-multilib-group-error.yaml - clang/test/Driver/baremetal-multilib-layered.yaml - clang/test/Driver/baremetal-multilib.yaml - clang/test/Driver/baremetal-sysroot.cpp - clang/test/Driver/baremetal.cpp - clang/test/Driver/print-multi-selection-flags.c - clang/test/Preprocessor/init-arm.c - clang/unittests/Driver/MultilibTest.cpp - clang/unittests/Interpreter/IncrementalCompilerBuilderTest.cpp - libcxx/utils/ci/run-buildbot - lld/test/ELF/lto/arm.ll - llvm/test/CodeGen/ARM/machine-sink-multidef.mir - llvm/test/CodeGen/ARM/store-prepostinc.mir - llvm/test/CodeGen/ARM/unschedule-reg-sequence.ll - llvm/test/CodeGen/Thumb/consthoist-few-dependents.ll - llvm/test/CodeGen/Thumb/consthoist-imm8-costs-1.ll - llvm/test/CodeGen/Thumb/pr42760.ll - llvm/test/CodeGen/Thumb/smul_fix.ll - llvm/test/CodeGen/Thumb/smul_fix_sat.ll - llvm/test/CodeGen/Thumb/umul_fix.ll - llvm/test/CodeGen/Thumb/umul_fix_sat.ll - llvm/test/CodeGen/Thumb2/LowOverheadLoops/spillingmove.mir - llvm/test/CodeGen/Thumb2/LowOverheadLoops/wls-search-pred.mir - llvm/test/CodeGen/Thumb2/high-reg-spill.mir - llvm/test/CodeGen/Thumb2/mve-pred-constfold.mir - llvm/test/CodeGen/Thumb2/mve-vpt-block-debug.mir - llvm/test/CodeGen/Thumb2/pipeliner-preserve-ties.mir - llvm/test/CodeGen/Thumb2/store-prepostinc.mir - llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll - llvm/test/Transforms/LoopVectorize/ARM/mve-hoist-runtime-checks.ll - llvm/unittests/TargetParser/TripleTest.cpp Fixes: llvm#89582.
When we parse 3-components triples, if the Arch and Env have been parsed successfully, we have to make a choice between Vendor and OS for the unrecoginzed component. Noramlly it is the middle one. In the current code, Vendor is choosed, and then OS is fallbacked to unknown. It is OK for most cases. But if the unrecoginzed component is `none`, it is expected to be OS instead of Vendor. Fixes: llvm#89582.
I've updated the title. Hopefully it's clearer now. |
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. Fixes: llvm#89582.
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. Fixes: llvm#89582.
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. Fixes: llvm#89582.
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. Fixes: llvm#89582.
When parsing a 3-component triple, after we determine Arch and Env, if the middle component is "none", treat it as OS instead of Vendor. See: https://discourse.llvm.org/t/rfc-baremetal-target-triple-normalization/78524 Fixes: #89582.
The expected value is that
none
andunknown
should be swapped.Caused by
std::string Triple::normalize(StringRef Str)
inllvm/lib/TargetParser/Triple.cpp
.The text was updated successfully, but these errors were encountered: