xref: /aosp_15_r20/external/llvm/test/CodeGen/Hexagon/rdf-copy.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=hexagon < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; Check that
4*9880d681SAndroid Build Coastguard Worker;     {
5*9880d681SAndroid Build Coastguard Worker;         r1 = r0
6*9880d681SAndroid Build Coastguard Worker;     }
7*9880d681SAndroid Build Coastguard Worker;     {
8*9880d681SAndroid Build Coastguard Worker;         r0 = memw(r1 + #0)
9*9880d681SAndroid Build Coastguard Worker;     }
10*9880d681SAndroid Build Coastguard Worker; was copy-propagated to
11*9880d681SAndroid Build Coastguard Worker;     {
12*9880d681SAndroid Build Coastguard Worker;         r1 = r0
13*9880d681SAndroid Build Coastguard Worker;         r0 = memw(r0 + #0)
14*9880d681SAndroid Build Coastguard Worker;     }
15*9880d681SAndroid Build Coastguard Worker;
16*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: LBB0_1
17*9880d681SAndroid Build Coastguard Worker; CHECK: [[DST:r[0-9]+]] = [[SRC:r[0-9]+]]
18*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: memw([[SRC]]
19*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: memw([[DST]]
20*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: LBB0_2
21*9880d681SAndroid Build Coastguard Worker
22*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"
23*9880d681SAndroid Build Coastguard Workertarget triple = "hexagon"
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker%union.t = type { %struct.t, [64 x i8] }
26*9880d681SAndroid Build Coastguard Worker%struct.t = type { [12 x i8], %struct.r*, double }
27*9880d681SAndroid Build Coastguard Worker%struct.r = type opaque
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdefine %union.t* @foo(%union.t* %chain) nounwind readonly {
30*9880d681SAndroid Build Coastguard Workerentry:
31*9880d681SAndroid Build Coastguard Worker  %tobool = icmp eq %union.t* %chain, null
32*9880d681SAndroid Build Coastguard Worker  br i1 %tobool, label %if.end, label %while.cond.preheader
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerwhile.cond.preheader:                             ; preds = %entry
35*9880d681SAndroid Build Coastguard Worker  br label %while.cond
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerwhile.cond:                                       ; preds = %while.cond.preheader, %while.cond
38*9880d681SAndroid Build Coastguard Worker  %chain.addr.0 = phi %union.t* [ %0, %while.cond ], [ %chain, %while.cond.preheader ]
39*9880d681SAndroid Build Coastguard Worker  %chain1 = bitcast %union.t* %chain.addr.0 to %union.t**
40*9880d681SAndroid Build Coastguard Worker  %0 = load %union.t*, %union.t** %chain1, align 4, !tbaa !0
41*9880d681SAndroid Build Coastguard Worker  %tobool2 = icmp eq %union.t* %0, null
42*9880d681SAndroid Build Coastguard Worker  br i1 %tobool2, label %if.end.loopexit, label %while.cond
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Workerif.end.loopexit:                                  ; preds = %while.cond
45*9880d681SAndroid Build Coastguard Worker  br label %if.end
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Workerif.end:                                           ; preds = %if.end.loopexit, %entry
48*9880d681SAndroid Build Coastguard Worker  %chain.addr.1 = phi %union.t* [ null, %entry ], [ %chain.addr.0, %if.end.loopexit ]
49*9880d681SAndroid Build Coastguard Worker  ret %union.t* %chain.addr.1
50*9880d681SAndroid Build Coastguard Worker}
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker!0 = !{!"any pointer", !1}
53*9880d681SAndroid Build Coastguard Worker!1 = !{!"omnipotent char", !2}
54*9880d681SAndroid Build Coastguard Worker!2 = !{!"Simple C/C++ TBAA"}
55