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

[InstSimplify] Missed optimization: X != Y implies X | Y != 0 #117436

Open
dtcxzyw opened this issue Nov 23, 2024 · 0 comments · May be fixed by #117443
Open

[InstSimplify] Missed optimization: X != Y implies X | Y != 0 #117436

dtcxzyw opened this issue Nov 23, 2024 · 0 comments · May be fixed by #117443

Comments

@dtcxzyw
Copy link
Member

dtcxzyw commented Nov 23, 2024

Proof: https://alive2.llvm.org/ce/z/cJ75Ya

define i1 @src(i8 %x, i8 %y) {
entry:
  %cond = icmp ne i8 %x, %y
  br i1 %cond, label %if.then, label %if.else

if.then:
  %or = or i8 %x, %y
  %cmp = icmp eq i8 %or, 0
  ret i1 %cmp

if.else:
  ret i1 false
}

define i1 @tgt(i8 %x, i8 %y) {
entry:
  %cond = icmp ne i8 %x, %y
  br i1 %cond, label %if.then, label %if.else

if.then:
  ret i1 false

if.else:
  ret i1 false
}

See also dtcxzyw/llvm-tools#32 and https://discourse.llvm.org/t/tuning-up-constraint-elimination/83213/5?u=dtcxzyw.

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