Skip to content
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

[ARM64] Inefficient range check sequence #21301

Closed
llvmbot opened this issue Sep 12, 2014 · 2 comments
Closed

[ARM64] Inefficient range check sequence #21301

llvmbot opened this issue Sep 12, 2014 · 2 comments
Assignees
Labels
backend:AArch64 bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 12, 2014

Bugzilla Link 20927
Resolution FIXED
Resolved on Jun 01, 2015 17:32
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @MatzeB

Extended Description

Consider:
long foo(long a, long b, long v1, long v2) {
if (a >= v1 && a < v2)
return b;
return 0;
}

We generate:
cmp x0, x2
csinc w8, wzr, wzr, lt
cmp x0, x3
csinc w9, wzr, wzr, ge
and w8, w8, w9
cmp w8, #​0
csel x0, x1, xzr, ne
ret

This seems like it should have generated something like:
mov x4, #​0
cmp x0, x2
ccmp x0, x3, #imm, lt
csel x0, x1, x4, ge
ret

@llvmbot
Copy link
Collaborator Author

llvmbot commented Sep 12, 2014

assigned to @MatzeB

@MatzeB
Copy link
Contributor

MatzeB commented Jun 2, 2015

Fixed by r238793.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants