Skip to content

Convert scmp/ucmp idioms into intrinsic call #99746

Closed
@dtcxzyw

Description

@dtcxzyw

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions