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

Wrong substitution of a PHI node #113992

Open
bongjunj opened this issue Oct 29, 2024 · 1 comment
Open

Wrong substitution of a PHI node #113992

bongjunj opened this issue Oct 29, 2024 · 1 comment

Comments

@bongjunj
Copy link

Alive2 report: https://alive2.llvm.org/ce/z/89TX9n

----------------------------------------
define i32 @sub_const_incoming0.2(i1 %b, i32 %x, i32 %y) {
entry:
  br i1 %b, label %if, label %then

if:
  br label %then

then:
  %p0 = phi i32 [ 42, %if ], [ %x, %entry ]
  %p1 = phi i32 [ undef, %if ], [ %y, %entry ]
  %r = sub i32 %p1, %p0
  ret i32 %r
}
=>
define i32 @sub_const_incoming0.2(i1 %b, i32 %x, i32 %y) {
entry:
  br i1 %b, label %if, label %then

if:
  br label %then

then:
  %p0 = phi i32 [ 42, %if ], [ %x, %entry ]
  %r = sub i32 %y, %p0
  ret i32 %r
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
i1 %b = #x1 (1)
i32 %x = poison
i32 %y = poison

Source:
  >> Jump to %if
  >> Jump to %then
i32 %p0 = #x0000002a (42)
i32 %p1 = #x00000000 (0)	[based on undef value]
i32 %r = #xffffffd6 (4294967254, -42)

Target:
  >> Jump to %if
  >> Jump to %then
i32 %p0 = #x0000002a (42)
i32 %r = poison
Source value: #xffffffd6 (4294967254, -42)
Target value: poison

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
@dtcxzyw
Copy link
Member

dtcxzyw commented Oct 30, 2024

Seems to be duplicate of #68683.

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

No branches or pull requests

2 participants