-
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
miscompile of non-canonical IR by AArch64 global isel backend #90532
Comments
@llvm/issue-subscribers-backend-aarch64 Author: John Regehr (regehr)
here's an odd-looking little fellow:
```llvm
define i1 @f(i1 %V) {
%C1 = fcmp false double 0.000000e+00, 0.000000e+00
%brmerge = select i1 %C1, i1 true, i1 %V
br i1 %brmerge, label %common.ret, label %SW_C
common.ret: SW_C:
_f:
_f:
i1 %C1 = #x0 (0)
then we get:
cc @DataCorrupted |
after irtranslator:
|
In IR the first conditional branch depends on |
The condition of the select is now false. The fcmp was constant folded and not probably deleted? The select is dead. |
The IRTranslator has an optimization for fcmp:
It is the source of the select condition being false. But where was the G_FCMP built and why is it the branch condition. |
The function parameter In MIR, there is a fourth BB with a conditional branch that depends on |
here's an odd-looking little fellow:
the SDAG backend (correctly) compiles it to this:
but global isel gives:
which I believe is incorrect. to see this, I'll give Alive's work showing why the function should return 1 when invoked as
f(0)
:but on the other hand, if we use this driver:
then we get:
cc @DataCorrupted
The text was updated successfully, but these errors were encountered: