Skip to content

[InstCombine] Infinite loop at -O3 #142405

@dtcxzyw

Description

@dtcxzyw

Reproducer: https://godbolt.org/z/aYWhfr6Y9

; bin/opt -passes=instcombine test.ll -S
define i32 @test(i32 noundef %0) {
entry:
  %cond.i = call i32 @llvm.smax.i32(i32 %0, i32 0)
  %conv.i = trunc i32 %cond.i to i16
  %conv21 = zext i16 %conv.i to i32
  %cmp22 = icmp eq i32 %0, %conv21
  %conv23 = zext i1 %cmp22 to i32
  %narrow.i = mul i32 %cond.i, %conv23
  %1 = and i32 %narrow.i, 1
  ret i32 %1
}

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions