Issue |
131635
|
Summary |
[SLP] Unguarded call to SmallVector::front() in TrySplitNode lambda
|
Labels |
new issue
|
Assignees |
|
Reporter |
wjschmidt
|
In the calculation of NewCost in TrySplitNode, there are two calls to VectorizableTree.front() that will assert if VectorizableTree is empty. The following small test case causes a crash as a result.
```
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"
%struct.1 = type { [258 x [1 x i32]], [56 x i8], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [2 x [16 x [1 x i32]]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [10 x [16 x [1 x i32]]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [16 x [1 x i32]], [2 x [1 x i32]], [56 x i8], [2 x [1 x i32]], [56 x i8], [2 x [1 x i32]], [56 x i8] }
define <8 x float> @foo(i32 %0, i32 %1, i32 %2) #0 {
entry:
%vecext.i615 = extractelement <4 x i32> zeroinitializer, i64 0
%idx.ext = sext i32 %vecext.i615 to i64
%__u.i613 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext
%idx.ext320 = sext i32 %0 to i64
%__u.i611 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext320
%idx.ext326 = sext i32 %1 to i64
%__u.i609 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext326
%idx.ext332 = sext i32 %2 to i64
%__u.i607 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext332
%idx.ext338 = zext i32 %2 to i64
%__u.i605 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext338
%idx.ext344 = zext i32 %1 to i64
%__u.i603 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext344
%idx.ext350 = zext i32 0 to i64
%__u.i601 = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext350
%idx.ext356 = zext i32 %0 to i64
%__u.i = getelementptr i8, ptr getelementptr inbounds (%struct.1, ptr null, i64 -35, i32 37, i64 0, i64 0), i64 %idx.ext356
ret <8 x float> zeroinitializer
}
attributes #0 = { "target-cpu"="core-avx2" }
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs