Skip to content

[CVP] Missed opportunity to do slt to ult conversion #69928

@vladimirradosavljevic

Description

@vladimirradosavljevic

For the following example, CVP is not converting slt to ult:

define i64 @test_select(i64 %arg, i64 %arg1) {
entry:
  %cmp1 = icmp ult i64 %arg, 64424509440
  %and = and i64 %arg1, 4294967295
  %cmp2 = icmp slt i64 %arg, %and
  %select = select i1 %cmp1, i1 %cmp2, i1 false
  br i1 %select, label %good, label %bad

bad:
  ret i64 1

good:
  ret i64 0
}

Proof that this transformation is valid.
On the other hand, it is able to convert it if there are 2 BBs and no select instruction.

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