Skip to content

[X86][SDAG] llc hang with constant vector splats #120906

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

Closed
dtcxzyw opened this issue Dec 22, 2024 · 1 comment
Closed

[X86][SDAG] llc hang with constant vector splats #120906

dtcxzyw opened this issue Dec 22, 2024 · 1 comment
Assignees
Labels
backend:X86 hang Compiler hang (infinite loop)

Comments

@dtcxzyw
Copy link
Member

dtcxzyw commented Dec 22, 2024

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

; bin/llc test.ll -o -
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define i32 @test(ptr %p) {
entry:
  store i32 564341309, ptr %p, align 4
  %0 = load i32, ptr %p, align 4
  %broadcast.splatinsert.1 = insertelement <4 x i32> zeroinitializer, i32 %0, i64 0
  %broadcast.splat.1 = shufflevector <4 x i32> %broadcast.splatinsert.1, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer
  %1 = icmp ugt <4 x i32> %broadcast.splat.1, splat (i32 -9)
  %2 = zext <4 x i1> %1 to <4 x i8>
  %3 = shl <4 x i8> splat (i8 11), %2
  %4 = or <4 x i8> %3, splat (i8 11)
  %bin.rdx = zext <4 x i8> %4 to <4 x i32>
  %5 = tail call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %bin.rdx)
  ret i32 %5
}
@dtcxzyw dtcxzyw added backend:X86 llvm:SelectionDAG SelectionDAGISel as well llvm:hang Compiler hang (infinite loop) labels Dec 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 22, 2024

@llvm/issue-subscribers-backend-x86

Author: Yingwei Zheng (dtcxzyw)

Reproducer: https://godbolt.org/z/PnsfYrfnf ``` ; bin/llc test.ll -o - target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu"

define i32 @test(ptr %p) {
entry:
store i32 564341309, ptr %p, align 4
%0 = load i32, ptr %p, align 4
%broadcast.splatinsert.1 = insertelement <4 x i32> zeroinitializer, i32 %0, i64 0
%broadcast.splat.1 = shufflevector <4 x i32> %broadcast.splatinsert.1, <4 x i32> zeroinitializer, <4 x i32> zeroinitializer
%1 = icmp ugt <4 x i32> %broadcast.splat.1, splat (i32 -9)
%2 = zext <4 x i1> %1 to <4 x i8>
%3 = shl <4 x i8> splat (i8 11), %2
%4 = or <4 x i8> %3, splat (i8 11)
%bin.rdx = zext <4 x i8> %4 to <4 x i32>
%5 = tail call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %bin.rdx)
ret i32 %5
}


</details>

@RKSimon RKSimon self-assigned this Dec 22, 2024
@EugeneZelenko EugeneZelenko added hang Compiler hang (infinite loop) and removed llvm:hang Compiler hang (infinite loop) llvm:SelectionDAG SelectionDAGISel as well labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 hang Compiler hang (infinite loop)
Projects
None yet
Development

No branches or pull requests

4 participants