-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
X86 rejects inlining of target-feature-wise compatible functions #67054
Comments
@llvm/issue-subscribers-backend-x86
This is an offshoot from https://github.com//issues/65205. Consider:
The credit for the testcase goes to @kalcutter. clang refuses to inline:
We should be able to inline the callee into the caller because the caller is allowed to use a superset of the instruction set that the callee is allowed to use. |
Here is the "patch" I posted to #65205: It looks like
Now, the only call in the callee in this case is the inline asm, which shouldn't pose a problem in terms of the ABI compatibility. Disregarding inline asm like so around
|
I think this is unnecessary. LLVM should be able to inline arbitrary functions if the caller has more instructions available than the callee. The current situation is caused by a flaw in the
I wonder if it would be possible for the |
When inlining across functions with different target features, we perform roughly two checks: 1. The caller features must be a superset of the callee features. 2. Calls in the callee cannot use types where the target features would change the call ABI (e.g. by changing whether something is passed in a zmm or two ymm registers). The latter check is very crude right now. The latter check currently also catches inline asm "calls". I believe that inline asm should be excluded from this check, as it is independent from the usual call ABI, and instead governed by the inline asm constraint string. Fixes #67054.
(cherry picked from commit cad6ad2)
…83820) When inlining across functions with different target features, we perform roughly two checks: 1. The caller features must be a superset of the callee features. 2. Calls in the callee cannot use types where the target features would change the call ABI (e.g. by changing whether something is passed in a zmm or two ymm registers). The latter check is very crude right now. The latter check currently also catches inline asm "calls". I believe that inline asm should be excluded from this check, as it is independent from the usual call ABI, and instead governed by the inline asm constraint string. Fixes llvm#67054. (cherry picked from commit e84182a)
(cherry picked from commit cad6ad2)
…83820) When inlining across functions with different target features, we perform roughly two checks: 1. The caller features must be a superset of the callee features. 2. Calls in the callee cannot use types where the target features would change the call ABI (e.g. by changing whether something is passed in a zmm or two ymm registers). The latter check is very crude right now. The latter check currently also catches inline asm "calls". I believe that inline asm should be excluded from this check, as it is independent from the usual call ABI, and instead governed by the inline asm constraint string. Fixes llvm#67054. (cherry picked from commit e84182a)
This is an offshoot from #65205. Consider:
The credit for the testcase goes to @kalcutter.
clang refuses to inline:
We should be able to inline the callee into the caller because the caller is allowed to use a superset of the instruction set that the callee is allowed to use.
The text was updated successfully, but these errors were encountered: