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

Convert scmp/ucmp idioms into intrinsic call #99746

Closed
dtcxzyw opened this issue Jul 20, 2024 · 0 comments · Fixed by #101049
Closed

Convert scmp/ucmp idioms into intrinsic call #99746

dtcxzyw opened this issue Jul 20, 2024 · 0 comments · Fixed by #101049

Comments

@dtcxzyw
Copy link
Member

dtcxzyw commented Jul 20, 2024

Alive2: https://alive2.llvm.org/ce/z/Q2ogeM

define i8 @src(i8 %x, i8 %y) {
  %8 = icmp ult i8 %x, %y
  %9 = icmp ne i8 %x, %y
  %..i.i = zext i1 %9 to i8
  %.0.i.i = select i1 %8, i8 -1, i8 %..i.i
  ret i8 %.0.i.i
}

define i8 @tgt(i8 %x, i8 %y) {
  %ucmp = call i8 @llvm.ucmp.i8(i8 %x, i8 %y)
  ret i8 %ucmp
}

cc @Poseydon42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants