1 ; RUN: opt -passes=dse -S < %s | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-f128:128:128-n8:16:32:64"
3 target triple = "x86_64-unknown-linux-gnu"
5 %struct.pair.162 = type { ptr, i32, [4 x i8] }
6 %struct.BasicBlock = type { %struct.Value, %struct.ilist_node.24, %struct.iplist.22, ptr }
7 %struct.Value = type { ptr, i8, i8, i16, ptr, ptr, ptr }
8 %struct.Type = type { ptr, i8, [3 x i8], i32, ptr }
9 %struct.LLVMContext = type { ptr }
10 %struct.LLVMContextImpl = type opaque
11 %struct.Use = type { ptr, ptr, %struct.PointerIntPair }
12 %struct.PointerIntPair = type { i64 }
13 %struct.StringMapEntry = type opaque
14 %struct.ilist_node.24 = type { %struct.ilist_half_node.23, ptr }
15 %struct.ilist_half_node.23 = type { ptr }
16 %struct.iplist.22 = type { %struct.ilist_traits.21, ptr }
17 %struct.ilist_traits.21 = type { %struct.ilist_half_node.25 }
18 %struct.ilist_half_node.25 = type { ptr }
19 %struct.Instruction = type { [52 x i8], %struct.ilist_node.26, ptr, %struct.DebugLoc }
20 %struct.ilist_node.26 = type { %struct.ilist_half_node.25, ptr }
21 %struct.DebugLoc = type { i32, i32 }
22 %struct.Function = type { %struct.GlobalValue, %struct.ilist_node.14, %struct.iplist.4, %struct.iplist, ptr, %struct.AttrListPtr }
23 %struct.GlobalValue = type <{ [52 x i8], [4 x i8], ptr, i8, i16, [5 x i8], %struct.basic_string }>
24 %struct.Module = type { ptr, %struct.iplist.20, %struct.iplist.16, %struct.iplist.12, %struct.vector.2, %struct.ilist, %struct.basic_string, ptr, %struct.OwningPtr, %struct.basic_string, %struct.basic_string, %struct.basic_string, ptr }
25 %struct.iplist.20 = type { %struct.ilist_traits.19, ptr }
26 %struct.ilist_traits.19 = type { %struct.ilist_node.18 }
27 %struct.ilist_node.18 = type { %struct.ilist_half_node.17, ptr }
28 %struct.ilist_half_node.17 = type { ptr }
29 %struct.GlobalVariable = type { %struct.GlobalValue, %struct.ilist_node.18, i8, [7 x i8] }
30 %struct.iplist.16 = type { %struct.ilist_traits.15, ptr }
31 %struct.ilist_traits.15 = type { %struct.ilist_node.14 }
32 %struct.ilist_node.14 = type { %struct.ilist_half_node.13, ptr }
33 %struct.ilist_half_node.13 = type { ptr }
34 %struct.iplist.12 = type { %struct.ilist_traits.11, ptr }
35 %struct.ilist_traits.11 = type { %struct.ilist_node.10 }
36 %struct.ilist_node.10 = type { %struct.ilist_half_node.9, ptr }
37 %struct.ilist_half_node.9 = type { ptr }
38 %struct.GlobalAlias = type { %struct.GlobalValue, %struct.ilist_node.10 }
39 %struct.vector.2 = type { %struct._Vector_base.1 }
40 %struct._Vector_base.1 = type { %struct._Vector_impl.0 }
41 %struct._Vector_impl.0 = type { ptr, ptr, ptr }
42 %struct.basic_string = type { %struct._Alloc_hider }
43 %struct._Alloc_hider = type { ptr }
44 %struct.ilist = type { %struct.iplist.8 }
45 %struct.iplist.8 = type { %struct.ilist_traits.7, ptr }
46 %struct.ilist_traits.7 = type { %struct.ilist_node.6 }
47 %struct.ilist_node.6 = type { %struct.ilist_half_node.5, ptr }
48 %struct.ilist_half_node.5 = type { ptr }
49 %struct.NamedMDNode = type { %struct.ilist_node.6, %struct.basic_string, ptr, ptr }
50 %struct.ValueSymbolTable = type opaque
51 %struct.OwningPtr = type { ptr }
52 %struct.GVMaterializer = type opaque
53 %struct.iplist.4 = type { %struct.ilist_traits.3, ptr }
54 %struct.ilist_traits.3 = type { %struct.ilist_half_node.23 }
55 %struct.iplist = type { %struct.ilist_traits, ptr }
56 %struct.ilist_traits = type { %struct.ilist_half_node }
57 %struct.ilist_half_node = type { ptr }
58 %struct.Argument = type { %struct.Value, %struct.ilist_node, ptr }
59 %struct.ilist_node = type { %struct.ilist_half_node, ptr }
60 %struct.AttrListPtr = type { ptr }
61 %struct.AttributeListImpl = type opaque
63 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind
65 ; CHECK: _ZSt9iter_swapIPSt4pairIPN4llvm10BasicBlockEjES5_EvT_T0_
68 define void @_ZSt9iter_swapIPSt4pairIPN4llvm10BasicBlockEjES5_EvT_T0_(ptr %__a, ptr %__b) nounwind uwtable inlinehint {
70 %memtmp = alloca %struct.pair.162, align 8
71 %0 = load ptr, ptr %__a, align 8
72 store ptr %0, ptr %memtmp, align 8
73 %1 = getelementptr inbounds %struct.pair.162, ptr %memtmp, i64 0, i32 1
74 %2 = getelementptr inbounds %struct.pair.162, ptr %__a, i64 0, i32 1
75 %3 = load i32, ptr %2, align 4
76 store i32 %3, ptr %1, align 8
77 call void @llvm.memcpy.p0.p0.i64(ptr %__a, ptr %__b, i64 12, i1 false)
78 call void @llvm.memcpy.p0.p0.i64(ptr %__b, ptr %memtmp, i64 12, i1 false)