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

[InstCombine] Commuted pattern is not handled #121701

Closed
dtcxzyw opened this issue Jan 5, 2025 · 0 comments · Fixed by #121766
Closed

[InstCombine] Commuted pattern is not handled #121701

dtcxzyw opened this issue Jan 5, 2025 · 0 comments · Fixed by #121766

Comments

@dtcxzyw
Copy link
Member

dtcxzyw commented Jan 5, 2025

https://godbolt.org/z/5bh5v8Tn6

define i1 @no_masks_with_logical_or1(i32 %a, i32 %b, i32 noundef %c) {
  %cmp1 = icmp ne i32 %a, 0
  %cmp2 = icmp ne i32 %b, 63
  %or1 = select i1 %cmp1, i1 true, i1 %cmp2
  %cmp3 = icmp ne i32 %c, 0
  %or2 = or i1 %or1, %cmp3
  ret i1 %or2
}

define i1 @no_masks_with_logical_or2(i32 %a, i32 %b, i32 noundef %c) {
  %cmp1 = icmp ne i32 %a, 0
  %cmp2 = icmp ne i32 %b, 63
  %or1 = select i1 %cmp1, i1 true, i1 %cmp2
  %cmp3 = icmp ne i32 %c, 0
  %or2 = or i1 %cmp3, %or1
  ret i1 %or2
}
define i1 @no_masks_with_logical_or1(i32 %a, i32 %b, i32 noundef %c) {
  %cmp2 = icmp ne i32 %b, 63
  %1 = or i32 %a, %c
  %2 = icmp ne i32 %1, 0
  %or2 = select i1 %2, i1 true, i1 %cmp2
  ret i1 %or2
}

define i1 @no_masks_with_logical_or2(i32 %a, i32 %b, i32 noundef %c) {
  %cmp1 = icmp ne i32 %a, 0
  %cmp2 = icmp ne i32 %b, 63
  %or1 = select i1 %cmp1, i1 true, i1 %cmp2
  %cmp3 = icmp ne i32 %c, 0
  %or2 = or i1 %cmp3, %or1
  ret i1 %or2
}
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.

1 participant