-
- Downloads
Disable a broken multiversioning optimisation
This patch skips redirect_to_specific clone for aarch64 and riscv, because the optimisation has two flaws: 1. It checks the value of the "target" attribute, even on targets that don't use this attribute for multiversioning. 2. The algorithm used is too aggressive, and will eliminate the indirection in some cases where the runtime choice of callee version can't be determined statically at compile time. A correct would need to verify that: - if the current caller version were selected at runtime, then the chosen callee version would be eligible for selection. - if any higher priority callee version were selected at runtime, then a higher priority caller version would have been eligble for selection (and hence the current caller version wouldn't have been selected). The current checks only verify a more restrictive version of the first condition, and don't check the second condition at all. Fixing the optimisation properly would require implementing target hooks to check for implications between version attributes, which is too complicated for this stage. However, I would like to see this hook implemented in the future, since it could also help deduplicate other multiversioning code. Since this behaviour has existed for x86 and powerpc for a while, I think it's best to preserve the existing behaviour on those targets, unless any maintainer for those targets disagrees. gcc/ChangeLog: * multiple_target.cc (redirect_to_specific_clone): Assert that "target" attribute is used for FMV before checking it. (ipa_target_clone): Skip redirect_to_specific_clone on some targets. gcc/testsuite/ChangeLog: * g++.target/aarch64/mv-pragma.C: New test.
Loading
Please register or sign in to comment