xref: /aosp_15_r20/external/llvm/test/CodeGen/Hexagon/mux-basic.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -O2 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; We should generate a MUX instruction for one of the selects.
3*9880d681SAndroid Build Coastguard Worker; CHECK: mux
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
5*9880d681SAndroid Build Coastguard Workertarget triple = "hexagon"
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker%struct.struct_t = type { i32, i32, i32 }
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine void @foo(%struct.struct_t* nocapture %p, i32 %x, i32 %y, i32 %z) nounwind {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker  %cmp = icmp slt i32 %x, 4660
12*9880d681SAndroid Build Coastguard Worker  %add = add nsw i32 %x, 1
13*9880d681SAndroid Build Coastguard Worker  %add.y = select i1 %cmp, i32 %add, i32 %y
14*9880d681SAndroid Build Coastguard Worker  %x.add.y = select i1 %cmp, i32 %x, i32 %y
15*9880d681SAndroid Build Coastguard Worker  %. = zext i1 %cmp to i32
16*9880d681SAndroid Build Coastguard Worker  %b.0 = add nsw i32 %x.add.y, %z
17*9880d681SAndroid Build Coastguard Worker  %a3 = getelementptr inbounds %struct.struct_t, %struct.struct_t* %p, i32 0, i32 0
18*9880d681SAndroid Build Coastguard Worker  store i32 %add.y, i32* %a3, align 4, !tbaa !0
19*9880d681SAndroid Build Coastguard Worker  %b4 = getelementptr inbounds %struct.struct_t, %struct.struct_t* %p, i32 0, i32 1
20*9880d681SAndroid Build Coastguard Worker  store i32 %b.0, i32* %b4, align 4, !tbaa !0
21*9880d681SAndroid Build Coastguard Worker  %c5 = getelementptr inbounds %struct.struct_t, %struct.struct_t* %p, i32 0, i32 2
22*9880d681SAndroid Build Coastguard Worker  store i32 %., i32* %c5, align 4, !tbaa !0
23*9880d681SAndroid Build Coastguard Worker  ret void
24*9880d681SAndroid Build Coastguard Worker}
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker!0 = !{!"int", !1}
27*9880d681SAndroid Build Coastguard Worker!1 = !{!"omnipotent char", !2}
28*9880d681SAndroid Build Coastguard Worker!2 = !{!"Simple C/C++ TBAA"}
29