Skip to content

[GVN] mishandle of phi #115301

Closed as not planned
Closed as not planned
@bongjunj

Description

@bongjunj

Alive2 report: https://alive2.llvm.org/ce/z/yDrndK

----------------------------------------
define double @fcmp_une_not_zero.2(double %x, double %y) {
entry:
  %cmp = fcmp une double %y, 2.000000
  br i1 %cmp, label %return, label %else

else:
  br label %return

return:
  %retval = phi double [ undef, %else ], [ %x, %entry ]
  ret double %retval
}
=>
define double @fcmp_une_not_zero.2(double %x, double %y) {
entry:
  %cmp = fcmp une double %y, 2.000000
  br i1 %cmp, label %return, label %else

else:
  br label %return

return:
  ret double %x
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
double %x = poison
double %y = #x4000000000000000 (2)

Source:
i1 %cmp = #x0 (0)
  >> Jump to %else
  >> Jump to %return
double %retval = #x0000000000000000 (+0.0)	[based on undef value]

Target:
i1 %cmp = #x0 (0)
  >> Jump to %else
  >> Jump to %return
Source value: #x0000000000000000 (+0.0)
Target value: poison

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions