llvm-project/llvm/test/Bitcode/bitcode-parseconstant-delay-select.ll
guopeilin 749ddd25e9 [BitcodeReader] Delay select until all constants resolved
Like the shuffle, we should treat the select delayed so that
all constants can be resolved.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D109053
2021-09-11 18:51:35 +08:00

14 lines
3.7 KiB
LLVM

; RUN: llvm-as < %s -preserve-bc-uselistorder=false | llvm-dis -disable-output
@a = external dso_local global i32, align 4
@c = external dso_local global [3 x i32], align 4
@b = external dso_local local_unnamed_addr global i32, align 4
define dso_local i32 @main() local_unnamed_addr {
middle.block:
br label %for.cond.for.end_crit_edge
for.cond.for.end_crit_edge: ; preds = %middle.block
store i32 extractelement (<4 x i32> select (<4 x i1> select (<4 x i1> <i1 icmp sle (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sle (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sle (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sle (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0)>, <4 x i1> <i1 icmp sge (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sge (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sge (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sge (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0)>, <4 x i1> zeroinitializer), <4 x i32> zeroinitializer, <4 x i32> select (<4 x i1> select (<4 x i1> <i1 icmp sgt (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sgt (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sgt (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0), i1 icmp sgt (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 0)>, <4 x i1> <i1 icmp eq (i32 sdiv (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 3), i32 0), i1 icmp eq (i32 sdiv (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 3), i32 0), i1 icmp eq (i32 sdiv (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 3), i32 0), i1 icmp eq (i32 sdiv (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 3), i32 0)>, <4 x i1> zeroinitializer), <4 x i32> <i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32)>, <4 x i32> <i32 lshr (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 31), i32 lshr (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 31), i32 lshr (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 31), i32 lshr (i32 zext (i1 icmp eq (i32* getelementptr inbounds ([3 x i32], [3 x i32]* @c, i64 0, i64 2), i32* @a) to i32), i32 31)>)), i32 3), i32* @b, align 4
ret i32 undef
}