1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2 2; RUN: llc -mtriple=armv5e-arm-none-eabi -mattr=+strict-align %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV5TE 3; RUN: llc -mtriple=thumbv6t2-arm-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-T2 4; RUN: llc -mtriple=armv4t-arm-none-eabi -mattr=+strict-align %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV4T 5; RUN: llc -mtriple=armv7-arm-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV7 6; RUN: llc -mtriple=armv7-arm-none-eabi -mattr=+strict-align %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV7-STRICT 7; RUN: llc -mtriple=armv6-arm-none-eabi %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV6 8; RUN: llc -mtriple=armv6-arm-none-eabi -mattr=+strict-align %s -o - | FileCheck %s --check-prefixes=CHECK-ARMV6-STRICT 9 10@x = common dso_local global i64 0, align 8 11@y = common dso_local global i64 0, align 8 12 13@x_unaligned = common dso_local global i64 0, align 1 14@y_unaligned = common dso_local global i64 0, align 1 15 16@x_aligned_4 = common dso_local global i64 0, align 4 17@y_aligned_4 = common dso_local global i64 0, align 4 18 19define void @test() { 20; CHECK-ARMV5TE-LABEL: test: 21; CHECK-ARMV5TE: @ %bb.0: @ %entry 22; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI0_0 23; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI0_1 24; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0] 25; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2] 26; CHECK-ARMV5TE-NEXT: bx lr 27; CHECK-ARMV5TE-NEXT: .p2align 2 28; CHECK-ARMV5TE-NEXT: @ %bb.1: 29; CHECK-ARMV5TE-NEXT: .LCPI0_0: 30; CHECK-ARMV5TE-NEXT: .long x 31; CHECK-ARMV5TE-NEXT: .LCPI0_1: 32; CHECK-ARMV5TE-NEXT: .long y 33; 34; CHECK-T2-LABEL: test: 35; CHECK-T2: @ %bb.0: @ %entry 36; CHECK-T2-NEXT: movw r0, :lower16:x 37; CHECK-T2-NEXT: movw r2, :lower16:y 38; CHECK-T2-NEXT: movt r0, :upper16:x 39; CHECK-T2-NEXT: movt r2, :upper16:y 40; CHECK-T2-NEXT: ldrd r0, r1, [r0] 41; CHECK-T2-NEXT: strd r0, r1, [r2] 42; CHECK-T2-NEXT: bx lr 43; 44; CHECK-ARMV4T-LABEL: test: 45; CHECK-ARMV4T: @ %bb.0: @ %entry 46; CHECK-ARMV4T-NEXT: ldr r0, .LCPI0_0 47; CHECK-ARMV4T-NEXT: ldr r2, .LCPI0_1 48; CHECK-ARMV4T-NEXT: ldr r1, [r0] 49; CHECK-ARMV4T-NEXT: ldr r0, [r0, #4] 50; CHECK-ARMV4T-NEXT: str r0, [r2, #4] 51; CHECK-ARMV4T-NEXT: str r1, [r2] 52; CHECK-ARMV4T-NEXT: bx lr 53; CHECK-ARMV4T-NEXT: .p2align 2 54; CHECK-ARMV4T-NEXT: @ %bb.1: 55; CHECK-ARMV4T-NEXT: .LCPI0_0: 56; CHECK-ARMV4T-NEXT: .long x 57; CHECK-ARMV4T-NEXT: .LCPI0_1: 58; CHECK-ARMV4T-NEXT: .long y 59; 60; CHECK-ARMV7-LABEL: test: 61; CHECK-ARMV7: @ %bb.0: @ %entry 62; CHECK-ARMV7-NEXT: movw r0, :lower16:x 63; CHECK-ARMV7-NEXT: movw r2, :lower16:y 64; CHECK-ARMV7-NEXT: movt r0, :upper16:x 65; CHECK-ARMV7-NEXT: movt r2, :upper16:y 66; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0] 67; CHECK-ARMV7-NEXT: strd r0, r1, [r2] 68; CHECK-ARMV7-NEXT: bx lr 69; 70; CHECK-ARMV7-STRICT-LABEL: test: 71; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 72; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 73; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 74; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 75; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 76; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0] 77; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2] 78; CHECK-ARMV7-STRICT-NEXT: bx lr 79; 80; CHECK-ARMV6-LABEL: test: 81; CHECK-ARMV6: @ %bb.0: @ %entry 82; CHECK-ARMV6-NEXT: ldr r0, .LCPI0_0 83; CHECK-ARMV6-NEXT: ldr r2, .LCPI0_1 84; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0] 85; CHECK-ARMV6-NEXT: strd r0, r1, [r2] 86; CHECK-ARMV6-NEXT: bx lr 87; CHECK-ARMV6-NEXT: .p2align 2 88; CHECK-ARMV6-NEXT: @ %bb.1: 89; CHECK-ARMV6-NEXT: .LCPI0_0: 90; CHECK-ARMV6-NEXT: .long x 91; CHECK-ARMV6-NEXT: .LCPI0_1: 92; CHECK-ARMV6-NEXT: .long y 93; 94; CHECK-ARMV6-STRICT-LABEL: test: 95; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 96; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI0_0 97; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI0_1 98; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0] 99; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2] 100; CHECK-ARMV6-STRICT-NEXT: bx lr 101; CHECK-ARMV6-STRICT-NEXT: .p2align 2 102; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 103; CHECK-ARMV6-STRICT-NEXT: .LCPI0_0: 104; CHECK-ARMV6-STRICT-NEXT: .long x 105; CHECK-ARMV6-STRICT-NEXT: .LCPI0_1: 106; CHECK-ARMV6-STRICT-NEXT: .long y 107entry: 108 109 110 111 112 %0 = load volatile i64, ptr @x, align 8 113 store volatile i64 %0, ptr @y, align 8 114 ret void 115} 116 117define void @test_unaligned() { 118; CHECK-ARMV5TE-LABEL: test_unaligned: 119; CHECK-ARMV5TE: @ %bb.0: @ %entry 120; CHECK-ARMV5TE-NEXT: .save {r4, r5, r6, lr} 121; CHECK-ARMV5TE-NEXT: push {r4, r5, r6, lr} 122; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI1_0 123; CHECK-ARMV5TE-NEXT: ldr r6, .LCPI1_1 124; CHECK-ARMV5TE-NEXT: mov r1, r0 125; CHECK-ARMV5TE-NEXT: ldrb lr, [r1, #4]! 126; CHECK-ARMV5TE-NEXT: ldrb r3, [r1, #2] 127; CHECK-ARMV5TE-NEXT: ldrb r12, [r1, #3] 128; CHECK-ARMV5TE-NEXT: ldrb r1, [r0] 129; CHECK-ARMV5TE-NEXT: ldrb r2, [r0, #1] 130; CHECK-ARMV5TE-NEXT: ldrb r4, [r0, #2] 131; CHECK-ARMV5TE-NEXT: ldrb r5, [r0, #3] 132; CHECK-ARMV5TE-NEXT: ldrb r0, [r0, #5] 133; CHECK-ARMV5TE-NEXT: strb r0, [r6, #5] 134; CHECK-ARMV5TE-NEXT: strb r4, [r6, #2] 135; CHECK-ARMV5TE-NEXT: strb r5, [r6, #3] 136; CHECK-ARMV5TE-NEXT: strb r1, [r6] 137; CHECK-ARMV5TE-NEXT: strb r2, [r6, #1] 138; CHECK-ARMV5TE-NEXT: strb lr, [r6, #4]! 139; CHECK-ARMV5TE-NEXT: strb r3, [r6, #2] 140; CHECK-ARMV5TE-NEXT: strb r12, [r6, #3] 141; CHECK-ARMV5TE-NEXT: pop {r4, r5, r6, pc} 142; CHECK-ARMV5TE-NEXT: .p2align 2 143; CHECK-ARMV5TE-NEXT: @ %bb.1: 144; CHECK-ARMV5TE-NEXT: .LCPI1_0: 145; CHECK-ARMV5TE-NEXT: .long x_unaligned 146; CHECK-ARMV5TE-NEXT: .LCPI1_1: 147; CHECK-ARMV5TE-NEXT: .long y_unaligned 148; 149; CHECK-T2-LABEL: test_unaligned: 150; CHECK-T2: @ %bb.0: @ %entry 151; CHECK-T2-NEXT: movw r0, :lower16:x_unaligned 152; CHECK-T2-NEXT: movw r2, :lower16:y_unaligned 153; CHECK-T2-NEXT: movt r0, :upper16:x_unaligned 154; CHECK-T2-NEXT: movt r2, :upper16:y_unaligned 155; CHECK-T2-NEXT: ldr r1, [r0] 156; CHECK-T2-NEXT: ldr r0, [r0, #4] 157; CHECK-T2-NEXT: str r0, [r2, #4] 158; CHECK-T2-NEXT: str r1, [r2] 159; CHECK-T2-NEXT: bx lr 160; 161; CHECK-ARMV4T-LABEL: test_unaligned: 162; CHECK-ARMV4T: @ %bb.0: @ %entry 163; CHECK-ARMV4T-NEXT: .save {r4, r5, r6, lr} 164; CHECK-ARMV4T-NEXT: push {r4, r5, r6, lr} 165; CHECK-ARMV4T-NEXT: ldr r0, .LCPI1_0 166; CHECK-ARMV4T-NEXT: ldr r6, .LCPI1_1 167; CHECK-ARMV4T-NEXT: mov r1, r0 168; CHECK-ARMV4T-NEXT: ldrb lr, [r1, #4]! 169; CHECK-ARMV4T-NEXT: ldrb r3, [r1, #2] 170; CHECK-ARMV4T-NEXT: ldrb r12, [r1, #3] 171; CHECK-ARMV4T-NEXT: ldrb r1, [r0] 172; CHECK-ARMV4T-NEXT: ldrb r2, [r0, #1] 173; CHECK-ARMV4T-NEXT: ldrb r4, [r0, #2] 174; CHECK-ARMV4T-NEXT: ldrb r5, [r0, #3] 175; CHECK-ARMV4T-NEXT: ldrb r0, [r0, #5] 176; CHECK-ARMV4T-NEXT: strb r0, [r6, #5] 177; CHECK-ARMV4T-NEXT: strb r4, [r6, #2] 178; CHECK-ARMV4T-NEXT: strb r5, [r6, #3] 179; CHECK-ARMV4T-NEXT: strb r1, [r6] 180; CHECK-ARMV4T-NEXT: strb r2, [r6, #1] 181; CHECK-ARMV4T-NEXT: strb lr, [r6, #4]! 182; CHECK-ARMV4T-NEXT: strb r3, [r6, #2] 183; CHECK-ARMV4T-NEXT: strb r12, [r6, #3] 184; CHECK-ARMV4T-NEXT: pop {r4, r5, r6, lr} 185; CHECK-ARMV4T-NEXT: bx lr 186; CHECK-ARMV4T-NEXT: .p2align 2 187; CHECK-ARMV4T-NEXT: @ %bb.1: 188; CHECK-ARMV4T-NEXT: .LCPI1_0: 189; CHECK-ARMV4T-NEXT: .long x_unaligned 190; CHECK-ARMV4T-NEXT: .LCPI1_1: 191; CHECK-ARMV4T-NEXT: .long y_unaligned 192; 193; CHECK-ARMV7-LABEL: test_unaligned: 194; CHECK-ARMV7: @ %bb.0: @ %entry 195; CHECK-ARMV7-NEXT: movw r0, :lower16:x_unaligned 196; CHECK-ARMV7-NEXT: movw r2, :lower16:y_unaligned 197; CHECK-ARMV7-NEXT: movt r0, :upper16:x_unaligned 198; CHECK-ARMV7-NEXT: movt r2, :upper16:y_unaligned 199; CHECK-ARMV7-NEXT: ldr r1, [r0] 200; CHECK-ARMV7-NEXT: ldr r0, [r0, #4] 201; CHECK-ARMV7-NEXT: str r0, [r2, #4] 202; CHECK-ARMV7-NEXT: str r1, [r2] 203; CHECK-ARMV7-NEXT: bx lr 204; 205; CHECK-ARMV7-STRICT-LABEL: test_unaligned: 206; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 207; CHECK-ARMV7-STRICT-NEXT: .save {r4, r5, r6, lr} 208; CHECK-ARMV7-STRICT-NEXT: push {r4, r5, r6, lr} 209; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x_unaligned 210; CHECK-ARMV7-STRICT-NEXT: movw r6, :lower16:y_unaligned 211; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x_unaligned 212; CHECK-ARMV7-STRICT-NEXT: movt r6, :upper16:y_unaligned 213; CHECK-ARMV7-STRICT-NEXT: mov r1, r0 214; CHECK-ARMV7-STRICT-NEXT: ldrb r12, [r1, #4]! 215; CHECK-ARMV7-STRICT-NEXT: ldrb r3, [r0] 216; CHECK-ARMV7-STRICT-NEXT: ldrb lr, [r0, #1] 217; CHECK-ARMV7-STRICT-NEXT: ldrb r2, [r0, #2] 218; CHECK-ARMV7-STRICT-NEXT: ldrb r4, [r0, #3] 219; CHECK-ARMV7-STRICT-NEXT: ldrb r0, [r0, #5] 220; CHECK-ARMV7-STRICT-NEXT: ldrb r5, [r1, #2] 221; CHECK-ARMV7-STRICT-NEXT: ldrb r1, [r1, #3] 222; CHECK-ARMV7-STRICT-NEXT: strb r0, [r6, #5] 223; CHECK-ARMV7-STRICT-NEXT: strb r2, [r6, #2] 224; CHECK-ARMV7-STRICT-NEXT: strb r4, [r6, #3] 225; CHECK-ARMV7-STRICT-NEXT: strb r3, [r6] 226; CHECK-ARMV7-STRICT-NEXT: strb lr, [r6, #1] 227; CHECK-ARMV7-STRICT-NEXT: strb r12, [r6, #4]! 228; CHECK-ARMV7-STRICT-NEXT: strb r5, [r6, #2] 229; CHECK-ARMV7-STRICT-NEXT: strb r1, [r6, #3] 230; CHECK-ARMV7-STRICT-NEXT: pop {r4, r5, r6, pc} 231; 232; CHECK-ARMV6-LABEL: test_unaligned: 233; CHECK-ARMV6: @ %bb.0: @ %entry 234; CHECK-ARMV6-NEXT: ldr r0, .LCPI1_0 235; CHECK-ARMV6-NEXT: ldr r2, .LCPI1_1 236; CHECK-ARMV6-NEXT: ldr r1, [r0] 237; CHECK-ARMV6-NEXT: ldr r0, [r0, #4] 238; CHECK-ARMV6-NEXT: str r0, [r2, #4] 239; CHECK-ARMV6-NEXT: str r1, [r2] 240; CHECK-ARMV6-NEXT: bx lr 241; CHECK-ARMV6-NEXT: .p2align 2 242; CHECK-ARMV6-NEXT: @ %bb.1: 243; CHECK-ARMV6-NEXT: .LCPI1_0: 244; CHECK-ARMV6-NEXT: .long x_unaligned 245; CHECK-ARMV6-NEXT: .LCPI1_1: 246; CHECK-ARMV6-NEXT: .long y_unaligned 247; 248; CHECK-ARMV6-STRICT-LABEL: test_unaligned: 249; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 250; CHECK-ARMV6-STRICT-NEXT: .save {r4, r5, r6, lr} 251; CHECK-ARMV6-STRICT-NEXT: push {r4, r5, r6, lr} 252; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI1_0 253; CHECK-ARMV6-STRICT-NEXT: ldr r6, .LCPI1_1 254; CHECK-ARMV6-STRICT-NEXT: mov r1, r0 255; CHECK-ARMV6-STRICT-NEXT: ldrb lr, [r1, #4]! 256; CHECK-ARMV6-STRICT-NEXT: ldrb r3, [r1, #2] 257; CHECK-ARMV6-STRICT-NEXT: ldrb r12, [r1, #3] 258; CHECK-ARMV6-STRICT-NEXT: ldrb r1, [r0] 259; CHECK-ARMV6-STRICT-NEXT: ldrb r2, [r0, #1] 260; CHECK-ARMV6-STRICT-NEXT: ldrb r4, [r0, #2] 261; CHECK-ARMV6-STRICT-NEXT: ldrb r5, [r0, #3] 262; CHECK-ARMV6-STRICT-NEXT: ldrb r0, [r0, #5] 263; CHECK-ARMV6-STRICT-NEXT: strb r0, [r6, #5] 264; CHECK-ARMV6-STRICT-NEXT: strb r4, [r6, #2] 265; CHECK-ARMV6-STRICT-NEXT: strb r5, [r6, #3] 266; CHECK-ARMV6-STRICT-NEXT: strb r1, [r6] 267; CHECK-ARMV6-STRICT-NEXT: strb r2, [r6, #1] 268; CHECK-ARMV6-STRICT-NEXT: strb lr, [r6, #4]! 269; CHECK-ARMV6-STRICT-NEXT: strb r3, [r6, #2] 270; CHECK-ARMV6-STRICT-NEXT: strb r12, [r6, #3] 271; CHECK-ARMV6-STRICT-NEXT: pop {r4, r5, r6, pc} 272; CHECK-ARMV6-STRICT-NEXT: .p2align 2 273; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 274; CHECK-ARMV6-STRICT-NEXT: .LCPI1_0: 275; CHECK-ARMV6-STRICT-NEXT: .long x_unaligned 276; CHECK-ARMV6-STRICT-NEXT: .LCPI1_1: 277; CHECK-ARMV6-STRICT-NEXT: .long y_unaligned 278entry: 279 %0 = load volatile i64, ptr @x_unaligned, align 1 280 store volatile i64 %0, ptr @y_unaligned, align 1 281 ret void 282} 283 284define void @test_align_4() { 285; CHECK-ARMV5TE-LABEL: test_align_4: 286; CHECK-ARMV5TE: @ %bb.0: @ %entry 287; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI2_0 288; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI2_1 289; CHECK-ARMV5TE-NEXT: ldr r1, [r0] 290; CHECK-ARMV5TE-NEXT: ldr r0, [r0, #4] 291; CHECK-ARMV5TE-NEXT: str r0, [r2, #4] 292; CHECK-ARMV5TE-NEXT: str r1, [r2] 293; CHECK-ARMV5TE-NEXT: bx lr 294; CHECK-ARMV5TE-NEXT: .p2align 2 295; CHECK-ARMV5TE-NEXT: @ %bb.1: 296; CHECK-ARMV5TE-NEXT: .LCPI2_0: 297; CHECK-ARMV5TE-NEXT: .long x_aligned_4 298; CHECK-ARMV5TE-NEXT: .LCPI2_1: 299; CHECK-ARMV5TE-NEXT: .long y_aligned_4 300; 301; CHECK-T2-LABEL: test_align_4: 302; CHECK-T2: @ %bb.0: @ %entry 303; CHECK-T2-NEXT: movw r0, :lower16:x_aligned_4 304; CHECK-T2-NEXT: movw r2, :lower16:y_aligned_4 305; CHECK-T2-NEXT: movt r0, :upper16:x_aligned_4 306; CHECK-T2-NEXT: movt r2, :upper16:y_aligned_4 307; CHECK-T2-NEXT: ldrd r0, r1, [r0] 308; CHECK-T2-NEXT: strd r0, r1, [r2] 309; CHECK-T2-NEXT: bx lr 310; 311; CHECK-ARMV4T-LABEL: test_align_4: 312; CHECK-ARMV4T: @ %bb.0: @ %entry 313; CHECK-ARMV4T-NEXT: ldr r0, .LCPI2_0 314; CHECK-ARMV4T-NEXT: ldr r2, .LCPI2_1 315; CHECK-ARMV4T-NEXT: ldr r1, [r0] 316; CHECK-ARMV4T-NEXT: ldr r0, [r0, #4] 317; CHECK-ARMV4T-NEXT: str r0, [r2, #4] 318; CHECK-ARMV4T-NEXT: str r1, [r2] 319; CHECK-ARMV4T-NEXT: bx lr 320; CHECK-ARMV4T-NEXT: .p2align 2 321; CHECK-ARMV4T-NEXT: @ %bb.1: 322; CHECK-ARMV4T-NEXT: .LCPI2_0: 323; CHECK-ARMV4T-NEXT: .long x_aligned_4 324; CHECK-ARMV4T-NEXT: .LCPI2_1: 325; CHECK-ARMV4T-NEXT: .long y_aligned_4 326; 327; CHECK-ARMV7-LABEL: test_align_4: 328; CHECK-ARMV7: @ %bb.0: @ %entry 329; CHECK-ARMV7-NEXT: movw r0, :lower16:x_aligned_4 330; CHECK-ARMV7-NEXT: movw r2, :lower16:y_aligned_4 331; CHECK-ARMV7-NEXT: movt r0, :upper16:x_aligned_4 332; CHECK-ARMV7-NEXT: movt r2, :upper16:y_aligned_4 333; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0] 334; CHECK-ARMV7-NEXT: strd r0, r1, [r2] 335; CHECK-ARMV7-NEXT: bx lr 336; 337; CHECK-ARMV7-STRICT-LABEL: test_align_4: 338; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 339; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x_aligned_4 340; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y_aligned_4 341; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x_aligned_4 342; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y_aligned_4 343; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0] 344; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2] 345; CHECK-ARMV7-STRICT-NEXT: bx lr 346; 347; CHECK-ARMV6-LABEL: test_align_4: 348; CHECK-ARMV6: @ %bb.0: @ %entry 349; CHECK-ARMV6-NEXT: ldr r0, .LCPI2_0 350; CHECK-ARMV6-NEXT: ldr r2, .LCPI2_1 351; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0] 352; CHECK-ARMV6-NEXT: strd r0, r1, [r2] 353; CHECK-ARMV6-NEXT: bx lr 354; CHECK-ARMV6-NEXT: .p2align 2 355; CHECK-ARMV6-NEXT: @ %bb.1: 356; CHECK-ARMV6-NEXT: .LCPI2_0: 357; CHECK-ARMV6-NEXT: .long x_aligned_4 358; CHECK-ARMV6-NEXT: .LCPI2_1: 359; CHECK-ARMV6-NEXT: .long y_aligned_4 360; 361; CHECK-ARMV6-STRICT-LABEL: test_align_4: 362; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 363; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI2_0 364; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI2_1 365; CHECK-ARMV6-STRICT-NEXT: ldr r1, [r0] 366; CHECK-ARMV6-STRICT-NEXT: ldr r0, [r0, #4] 367; CHECK-ARMV6-STRICT-NEXT: str r0, [r2, #4] 368; CHECK-ARMV6-STRICT-NEXT: str r1, [r2] 369; CHECK-ARMV6-STRICT-NEXT: bx lr 370; CHECK-ARMV6-STRICT-NEXT: .p2align 2 371; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 372; CHECK-ARMV6-STRICT-NEXT: .LCPI2_0: 373; CHECK-ARMV6-STRICT-NEXT: .long x_aligned_4 374; CHECK-ARMV6-STRICT-NEXT: .LCPI2_1: 375; CHECK-ARMV6-STRICT-NEXT: .long y_aligned_4 376entry: 377 %0 = load volatile i64, ptr @x_aligned_4, align 4 378 store volatile i64 %0, ptr @y_aligned_4, align 4 379 ret void 380} 381 382define void @test_offset() { 383; CHECK-ARMV5TE-LABEL: test_offset: 384; CHECK-ARMV5TE: @ %bb.0: @ %entry 385; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI3_0 386; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI3_1 387; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0, #-4] 388; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2, #-4] 389; CHECK-ARMV5TE-NEXT: bx lr 390; CHECK-ARMV5TE-NEXT: .p2align 2 391; CHECK-ARMV5TE-NEXT: @ %bb.1: 392; CHECK-ARMV5TE-NEXT: .LCPI3_0: 393; CHECK-ARMV5TE-NEXT: .long x 394; CHECK-ARMV5TE-NEXT: .LCPI3_1: 395; CHECK-ARMV5TE-NEXT: .long y 396; 397; CHECK-T2-LABEL: test_offset: 398; CHECK-T2: @ %bb.0: @ %entry 399; CHECK-T2-NEXT: movw r0, :lower16:x 400; CHECK-T2-NEXT: movw r2, :lower16:y 401; CHECK-T2-NEXT: movt r0, :upper16:x 402; CHECK-T2-NEXT: movt r2, :upper16:y 403; CHECK-T2-NEXT: ldrd r0, r1, [r0, #-4] 404; CHECK-T2-NEXT: strd r0, r1, [r2, #-4] 405; CHECK-T2-NEXT: bx lr 406; 407; CHECK-ARMV4T-LABEL: test_offset: 408; CHECK-ARMV4T: @ %bb.0: @ %entry 409; CHECK-ARMV4T-NEXT: ldr r0, .LCPI3_0 410; CHECK-ARMV4T-NEXT: ldr r2, .LCPI3_1 411; CHECK-ARMV4T-NEXT: ldr r1, [r0, #-4] 412; CHECK-ARMV4T-NEXT: ldr r0, [r0] 413; CHECK-ARMV4T-NEXT: str r0, [r2] 414; CHECK-ARMV4T-NEXT: str r1, [r2, #-4] 415; CHECK-ARMV4T-NEXT: bx lr 416; CHECK-ARMV4T-NEXT: .p2align 2 417; CHECK-ARMV4T-NEXT: @ %bb.1: 418; CHECK-ARMV4T-NEXT: .LCPI3_0: 419; CHECK-ARMV4T-NEXT: .long x 420; CHECK-ARMV4T-NEXT: .LCPI3_1: 421; CHECK-ARMV4T-NEXT: .long y 422; 423; CHECK-ARMV7-LABEL: test_offset: 424; CHECK-ARMV7: @ %bb.0: @ %entry 425; CHECK-ARMV7-NEXT: movw r0, :lower16:x 426; CHECK-ARMV7-NEXT: movw r2, :lower16:y 427; CHECK-ARMV7-NEXT: movt r0, :upper16:x 428; CHECK-ARMV7-NEXT: movt r2, :upper16:y 429; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0, #-4] 430; CHECK-ARMV7-NEXT: strd r0, r1, [r2, #-4] 431; CHECK-ARMV7-NEXT: bx lr 432; 433; CHECK-ARMV7-STRICT-LABEL: test_offset: 434; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 435; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 436; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 437; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 438; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 439; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0, #-4] 440; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2, #-4] 441; CHECK-ARMV7-STRICT-NEXT: bx lr 442; 443; CHECK-ARMV6-LABEL: test_offset: 444; CHECK-ARMV6: @ %bb.0: @ %entry 445; CHECK-ARMV6-NEXT: ldr r0, .LCPI3_0 446; CHECK-ARMV6-NEXT: ldr r2, .LCPI3_1 447; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0, #-4] 448; CHECK-ARMV6-NEXT: strd r0, r1, [r2, #-4] 449; CHECK-ARMV6-NEXT: bx lr 450; CHECK-ARMV6-NEXT: .p2align 2 451; CHECK-ARMV6-NEXT: @ %bb.1: 452; CHECK-ARMV6-NEXT: .LCPI3_0: 453; CHECK-ARMV6-NEXT: .long x 454; CHECK-ARMV6-NEXT: .LCPI3_1: 455; CHECK-ARMV6-NEXT: .long y 456; 457; CHECK-ARMV6-STRICT-LABEL: test_offset: 458; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 459; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI3_0 460; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI3_1 461; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0, #-4] 462; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2, #-4] 463; CHECK-ARMV6-STRICT-NEXT: bx lr 464; CHECK-ARMV6-STRICT-NEXT: .p2align 2 465; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 466; CHECK-ARMV6-STRICT-NEXT: .LCPI3_0: 467; CHECK-ARMV6-STRICT-NEXT: .long x 468; CHECK-ARMV6-STRICT-NEXT: .LCPI3_1: 469; CHECK-ARMV6-STRICT-NEXT: .long y 470entry: 471 %0 = load volatile i64, ptr getelementptr (i8, ptr @x, i32 -4), align 8 472 store volatile i64 %0, ptr getelementptr (i8, ptr @y, i32 -4), align 8 473 ret void 474} 475 476define void @test_offset_1() { 477; CHECK-ARMV5TE-LABEL: test_offset_1: 478; CHECK-ARMV5TE: @ %bb.0: @ %entry 479; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI4_0 480; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI4_1 481; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0, #255] 482; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2, #255] 483; CHECK-ARMV5TE-NEXT: bx lr 484; CHECK-ARMV5TE-NEXT: .p2align 2 485; CHECK-ARMV5TE-NEXT: @ %bb.1: 486; CHECK-ARMV5TE-NEXT: .LCPI4_0: 487; CHECK-ARMV5TE-NEXT: .long x 488; CHECK-ARMV5TE-NEXT: .LCPI4_1: 489; CHECK-ARMV5TE-NEXT: .long y 490; 491; CHECK-T2-LABEL: test_offset_1: 492; CHECK-T2: @ %bb.0: @ %entry 493; CHECK-T2-NEXT: movw r0, :lower16:y 494; CHECK-T2-NEXT: movw r1, :lower16:x 495; CHECK-T2-NEXT: movt r0, :upper16:y 496; CHECK-T2-NEXT: movt r1, :upper16:x 497; CHECK-T2-NEXT: adds r1, #255 498; CHECK-T2-NEXT: adds r0, #255 499; CHECK-T2-NEXT: ldrd r1, r2, [r1] 500; CHECK-T2-NEXT: strd r1, r2, [r0] 501; CHECK-T2-NEXT: bx lr 502; 503; CHECK-ARMV4T-LABEL: test_offset_1: 504; CHECK-ARMV4T: @ %bb.0: @ %entry 505; CHECK-ARMV4T-NEXT: ldr r0, .LCPI4_0 506; CHECK-ARMV4T-NEXT: ldr r2, .LCPI4_1 507; CHECK-ARMV4T-NEXT: ldr r1, [r0, #255] 508; CHECK-ARMV4T-NEXT: ldr r0, [r0, #259] 509; CHECK-ARMV4T-NEXT: str r0, [r2, #259] 510; CHECK-ARMV4T-NEXT: str r1, [r2, #255] 511; CHECK-ARMV4T-NEXT: bx lr 512; CHECK-ARMV4T-NEXT: .p2align 2 513; CHECK-ARMV4T-NEXT: @ %bb.1: 514; CHECK-ARMV4T-NEXT: .LCPI4_0: 515; CHECK-ARMV4T-NEXT: .long x 516; CHECK-ARMV4T-NEXT: .LCPI4_1: 517; CHECK-ARMV4T-NEXT: .long y 518; 519; CHECK-ARMV7-LABEL: test_offset_1: 520; CHECK-ARMV7: @ %bb.0: @ %entry 521; CHECK-ARMV7-NEXT: movw r0, :lower16:x 522; CHECK-ARMV7-NEXT: movw r2, :lower16:y 523; CHECK-ARMV7-NEXT: movt r0, :upper16:x 524; CHECK-ARMV7-NEXT: movt r2, :upper16:y 525; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0, #255] 526; CHECK-ARMV7-NEXT: strd r0, r1, [r2, #255] 527; CHECK-ARMV7-NEXT: bx lr 528; 529; CHECK-ARMV7-STRICT-LABEL: test_offset_1: 530; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 531; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 532; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 533; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 534; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 535; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0, #255] 536; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2, #255] 537; CHECK-ARMV7-STRICT-NEXT: bx lr 538; 539; CHECK-ARMV6-LABEL: test_offset_1: 540; CHECK-ARMV6: @ %bb.0: @ %entry 541; CHECK-ARMV6-NEXT: ldr r0, .LCPI4_0 542; CHECK-ARMV6-NEXT: ldr r2, .LCPI4_1 543; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0, #255] 544; CHECK-ARMV6-NEXT: strd r0, r1, [r2, #255] 545; CHECK-ARMV6-NEXT: bx lr 546; CHECK-ARMV6-NEXT: .p2align 2 547; CHECK-ARMV6-NEXT: @ %bb.1: 548; CHECK-ARMV6-NEXT: .LCPI4_0: 549; CHECK-ARMV6-NEXT: .long x 550; CHECK-ARMV6-NEXT: .LCPI4_1: 551; CHECK-ARMV6-NEXT: .long y 552; 553; CHECK-ARMV6-STRICT-LABEL: test_offset_1: 554; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 555; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI4_0 556; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI4_1 557; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0, #255] 558; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2, #255] 559; CHECK-ARMV6-STRICT-NEXT: bx lr 560; CHECK-ARMV6-STRICT-NEXT: .p2align 2 561; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 562; CHECK-ARMV6-STRICT-NEXT: .LCPI4_0: 563; CHECK-ARMV6-STRICT-NEXT: .long x 564; CHECK-ARMV6-STRICT-NEXT: .LCPI4_1: 565; CHECK-ARMV6-STRICT-NEXT: .long y 566 567entry: 568 %0 = load volatile i64, ptr getelementptr (i8, ptr @x, i32 255), align 8 569 store volatile i64 %0, ptr getelementptr (i8, ptr @y, i32 255), align 8 570 ret void 571} 572 573define void @test_offset_2() { 574; CHECK-ARMV5TE-LABEL: test_offset_2: 575; CHECK-ARMV5TE: @ %bb.0: @ %entry 576; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI5_0 577; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI5_1 578; CHECK-ARMV5TE-NEXT: add r0, r0, #256 579; CHECK-ARMV5TE-NEXT: add r2, r2, #256 580; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0] 581; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2] 582; CHECK-ARMV5TE-NEXT: bx lr 583; CHECK-ARMV5TE-NEXT: .p2align 2 584; CHECK-ARMV5TE-NEXT: @ %bb.1: 585; CHECK-ARMV5TE-NEXT: .LCPI5_0: 586; CHECK-ARMV5TE-NEXT: .long x 587; CHECK-ARMV5TE-NEXT: .LCPI5_1: 588; CHECK-ARMV5TE-NEXT: .long y 589; 590; CHECK-T2-LABEL: test_offset_2: 591; CHECK-T2: @ %bb.0: @ %entry 592; CHECK-T2-NEXT: movw r0, :lower16:x 593; CHECK-T2-NEXT: movw r2, :lower16:y 594; CHECK-T2-NEXT: movt r0, :upper16:x 595; CHECK-T2-NEXT: movt r2, :upper16:y 596; CHECK-T2-NEXT: ldrd r0, r1, [r0, #256] 597; CHECK-T2-NEXT: strd r0, r1, [r2, #256] 598; CHECK-T2-NEXT: bx lr 599; 600; CHECK-ARMV4T-LABEL: test_offset_2: 601; CHECK-ARMV4T: @ %bb.0: @ %entry 602; CHECK-ARMV4T-NEXT: ldr r0, .LCPI5_0 603; CHECK-ARMV4T-NEXT: ldr r2, .LCPI5_1 604; CHECK-ARMV4T-NEXT: ldr r1, [r0, #256] 605; CHECK-ARMV4T-NEXT: ldr r0, [r0, #260] 606; CHECK-ARMV4T-NEXT: str r0, [r2, #260] 607; CHECK-ARMV4T-NEXT: str r1, [r2, #256] 608; CHECK-ARMV4T-NEXT: bx lr 609; CHECK-ARMV4T-NEXT: .p2align 2 610; CHECK-ARMV4T-NEXT: @ %bb.1: 611; CHECK-ARMV4T-NEXT: .LCPI5_0: 612; CHECK-ARMV4T-NEXT: .long x 613; CHECK-ARMV4T-NEXT: .LCPI5_1: 614; CHECK-ARMV4T-NEXT: .long y 615; 616; CHECK-ARMV7-LABEL: test_offset_2: 617; CHECK-ARMV7: @ %bb.0: @ %entry 618; CHECK-ARMV7-NEXT: movw r0, :lower16:x 619; CHECK-ARMV7-NEXT: movw r2, :lower16:y 620; CHECK-ARMV7-NEXT: movt r0, :upper16:x 621; CHECK-ARMV7-NEXT: movt r2, :upper16:y 622; CHECK-ARMV7-NEXT: add r0, r0, #256 623; CHECK-ARMV7-NEXT: add r2, r2, #256 624; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0] 625; CHECK-ARMV7-NEXT: strd r0, r1, [r2] 626; CHECK-ARMV7-NEXT: bx lr 627; 628; CHECK-ARMV7-STRICT-LABEL: test_offset_2: 629; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 630; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 631; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 632; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 633; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 634; CHECK-ARMV7-STRICT-NEXT: add r0, r0, #256 635; CHECK-ARMV7-STRICT-NEXT: add r2, r2, #256 636; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0] 637; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2] 638; CHECK-ARMV7-STRICT-NEXT: bx lr 639; 640; CHECK-ARMV6-LABEL: test_offset_2: 641; CHECK-ARMV6: @ %bb.0: @ %entry 642; CHECK-ARMV6-NEXT: ldr r0, .LCPI5_0 643; CHECK-ARMV6-NEXT: ldr r2, .LCPI5_1 644; CHECK-ARMV6-NEXT: add r0, r0, #256 645; CHECK-ARMV6-NEXT: add r2, r2, #256 646; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0] 647; CHECK-ARMV6-NEXT: strd r0, r1, [r2] 648; CHECK-ARMV6-NEXT: bx lr 649; CHECK-ARMV6-NEXT: .p2align 2 650; CHECK-ARMV6-NEXT: @ %bb.1: 651; CHECK-ARMV6-NEXT: .LCPI5_0: 652; CHECK-ARMV6-NEXT: .long x 653; CHECK-ARMV6-NEXT: .LCPI5_1: 654; CHECK-ARMV6-NEXT: .long y 655; 656; CHECK-ARMV6-STRICT-LABEL: test_offset_2: 657; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 658; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI5_0 659; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI5_1 660; CHECK-ARMV6-STRICT-NEXT: add r0, r0, #256 661; CHECK-ARMV6-STRICT-NEXT: add r2, r2, #256 662; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0] 663; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2] 664; CHECK-ARMV6-STRICT-NEXT: bx lr 665; CHECK-ARMV6-STRICT-NEXT: .p2align 2 666; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 667; CHECK-ARMV6-STRICT-NEXT: .LCPI5_0: 668; CHECK-ARMV6-STRICT-NEXT: .long x 669; CHECK-ARMV6-STRICT-NEXT: .LCPI5_1: 670; CHECK-ARMV6-STRICT-NEXT: .long y 671 672entry: 673 %0 = load volatile i64, ptr getelementptr (i8, ptr @x, i32 256), align 8 674 store volatile i64 %0, ptr getelementptr (i8, ptr @y, i32 256), align 8 675 ret void 676} 677 678define void @test_offset_3() { 679; CHECK-ARMV5TE-LABEL: test_offset_3: 680; CHECK-ARMV5TE: @ %bb.0: @ %entry 681; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI6_0 682; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI6_1 683; CHECK-ARMV5TE-NEXT: add r0, r0, #1020 684; CHECK-ARMV5TE-NEXT: add r2, r2, #1020 685; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0] 686; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2] 687; CHECK-ARMV5TE-NEXT: bx lr 688; CHECK-ARMV5TE-NEXT: .p2align 2 689; CHECK-ARMV5TE-NEXT: @ %bb.1: 690; CHECK-ARMV5TE-NEXT: .LCPI6_0: 691; CHECK-ARMV5TE-NEXT: .long x 692; CHECK-ARMV5TE-NEXT: .LCPI6_1: 693; CHECK-ARMV5TE-NEXT: .long y 694; 695; CHECK-T2-LABEL: test_offset_3: 696; CHECK-T2: @ %bb.0: @ %entry 697; CHECK-T2-NEXT: movw r0, :lower16:x 698; CHECK-T2-NEXT: movw r2, :lower16:y 699; CHECK-T2-NEXT: movt r0, :upper16:x 700; CHECK-T2-NEXT: movt r2, :upper16:y 701; CHECK-T2-NEXT: ldrd r0, r1, [r0, #1020] 702; CHECK-T2-NEXT: strd r0, r1, [r2, #1020] 703; CHECK-T2-NEXT: bx lr 704; 705; CHECK-ARMV4T-LABEL: test_offset_3: 706; CHECK-ARMV4T: @ %bb.0: @ %entry 707; CHECK-ARMV4T-NEXT: ldr r0, .LCPI6_0 708; CHECK-ARMV4T-NEXT: ldr r2, .LCPI6_1 709; CHECK-ARMV4T-NEXT: ldr r1, [r0, #1020] 710; CHECK-ARMV4T-NEXT: ldr r0, [r0, #1024] 711; CHECK-ARMV4T-NEXT: str r0, [r2, #1024] 712; CHECK-ARMV4T-NEXT: str r1, [r2, #1020] 713; CHECK-ARMV4T-NEXT: bx lr 714; CHECK-ARMV4T-NEXT: .p2align 2 715; CHECK-ARMV4T-NEXT: @ %bb.1: 716; CHECK-ARMV4T-NEXT: .LCPI6_0: 717; CHECK-ARMV4T-NEXT: .long x 718; CHECK-ARMV4T-NEXT: .LCPI6_1: 719; CHECK-ARMV4T-NEXT: .long y 720; 721; CHECK-ARMV7-LABEL: test_offset_3: 722; CHECK-ARMV7: @ %bb.0: @ %entry 723; CHECK-ARMV7-NEXT: movw r0, :lower16:x 724; CHECK-ARMV7-NEXT: movw r2, :lower16:y 725; CHECK-ARMV7-NEXT: movt r0, :upper16:x 726; CHECK-ARMV7-NEXT: movt r2, :upper16:y 727; CHECK-ARMV7-NEXT: add r0, r0, #1020 728; CHECK-ARMV7-NEXT: add r2, r2, #1020 729; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0] 730; CHECK-ARMV7-NEXT: strd r0, r1, [r2] 731; CHECK-ARMV7-NEXT: bx lr 732; 733; CHECK-ARMV7-STRICT-LABEL: test_offset_3: 734; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 735; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 736; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 737; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 738; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 739; CHECK-ARMV7-STRICT-NEXT: add r0, r0, #1020 740; CHECK-ARMV7-STRICT-NEXT: add r2, r2, #1020 741; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0] 742; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2] 743; CHECK-ARMV7-STRICT-NEXT: bx lr 744; 745; CHECK-ARMV6-LABEL: test_offset_3: 746; CHECK-ARMV6: @ %bb.0: @ %entry 747; CHECK-ARMV6-NEXT: ldr r0, .LCPI6_0 748; CHECK-ARMV6-NEXT: ldr r2, .LCPI6_1 749; CHECK-ARMV6-NEXT: add r0, r0, #1020 750; CHECK-ARMV6-NEXT: add r2, r2, #1020 751; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0] 752; CHECK-ARMV6-NEXT: strd r0, r1, [r2] 753; CHECK-ARMV6-NEXT: bx lr 754; CHECK-ARMV6-NEXT: .p2align 2 755; CHECK-ARMV6-NEXT: @ %bb.1: 756; CHECK-ARMV6-NEXT: .LCPI6_0: 757; CHECK-ARMV6-NEXT: .long x 758; CHECK-ARMV6-NEXT: .LCPI6_1: 759; CHECK-ARMV6-NEXT: .long y 760; 761; CHECK-ARMV6-STRICT-LABEL: test_offset_3: 762; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 763; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI6_0 764; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI6_1 765; CHECK-ARMV6-STRICT-NEXT: add r0, r0, #1020 766; CHECK-ARMV6-STRICT-NEXT: add r2, r2, #1020 767; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0] 768; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2] 769; CHECK-ARMV6-STRICT-NEXT: bx lr 770; CHECK-ARMV6-STRICT-NEXT: .p2align 2 771; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 772; CHECK-ARMV6-STRICT-NEXT: .LCPI6_0: 773; CHECK-ARMV6-STRICT-NEXT: .long x 774; CHECK-ARMV6-STRICT-NEXT: .LCPI6_1: 775; CHECK-ARMV6-STRICT-NEXT: .long y 776 777entry: 778 %0 = load volatile i64, ptr getelementptr (i8, ptr @x, i32 1020), align 8 779 store volatile i64 %0, ptr getelementptr (i8, ptr @y, i32 1020), align 8 780 ret void 781} 782 783define void @test_offset_4() { 784; CHECK-ARMV5TE-LABEL: test_offset_4: 785; CHECK-ARMV5TE: @ %bb.0: @ %entry 786; CHECK-ARMV5TE-NEXT: ldr r0, .LCPI7_0 787; CHECK-ARMV5TE-NEXT: ldr r2, .LCPI7_1 788; CHECK-ARMV5TE-NEXT: add r0, r0, #1024 789; CHECK-ARMV5TE-NEXT: add r2, r2, #1024 790; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [r0] 791; CHECK-ARMV5TE-NEXT: strd r0, r1, [r2] 792; CHECK-ARMV5TE-NEXT: bx lr 793; CHECK-ARMV5TE-NEXT: .p2align 2 794; CHECK-ARMV5TE-NEXT: @ %bb.1: 795; CHECK-ARMV5TE-NEXT: .LCPI7_0: 796; CHECK-ARMV5TE-NEXT: .long x 797; CHECK-ARMV5TE-NEXT: .LCPI7_1: 798; CHECK-ARMV5TE-NEXT: .long y 799; 800; CHECK-T2-LABEL: test_offset_4: 801; CHECK-T2: @ %bb.0: @ %entry 802; CHECK-T2-NEXT: movw r0, :lower16:y 803; CHECK-T2-NEXT: movw r1, :lower16:x 804; CHECK-T2-NEXT: movt r0, :upper16:y 805; CHECK-T2-NEXT: movt r1, :upper16:x 806; CHECK-T2-NEXT: add.w r1, r1, #1024 807; CHECK-T2-NEXT: add.w r0, r0, #1024 808; CHECK-T2-NEXT: ldrd r1, r2, [r1] 809; CHECK-T2-NEXT: strd r1, r2, [r0] 810; CHECK-T2-NEXT: bx lr 811; 812; CHECK-ARMV4T-LABEL: test_offset_4: 813; CHECK-ARMV4T: @ %bb.0: @ %entry 814; CHECK-ARMV4T-NEXT: ldr r0, .LCPI7_0 815; CHECK-ARMV4T-NEXT: ldr r2, .LCPI7_1 816; CHECK-ARMV4T-NEXT: ldr r1, [r0, #1024] 817; CHECK-ARMV4T-NEXT: ldr r0, [r0, #1028] 818; CHECK-ARMV4T-NEXT: str r0, [r2, #1028] 819; CHECK-ARMV4T-NEXT: str r1, [r2, #1024] 820; CHECK-ARMV4T-NEXT: bx lr 821; CHECK-ARMV4T-NEXT: .p2align 2 822; CHECK-ARMV4T-NEXT: @ %bb.1: 823; CHECK-ARMV4T-NEXT: .LCPI7_0: 824; CHECK-ARMV4T-NEXT: .long x 825; CHECK-ARMV4T-NEXT: .LCPI7_1: 826; CHECK-ARMV4T-NEXT: .long y 827; 828; CHECK-ARMV7-LABEL: test_offset_4: 829; CHECK-ARMV7: @ %bb.0: @ %entry 830; CHECK-ARMV7-NEXT: movw r0, :lower16:x 831; CHECK-ARMV7-NEXT: movw r2, :lower16:y 832; CHECK-ARMV7-NEXT: movt r0, :upper16:x 833; CHECK-ARMV7-NEXT: movt r2, :upper16:y 834; CHECK-ARMV7-NEXT: add r0, r0, #1024 835; CHECK-ARMV7-NEXT: add r2, r2, #1024 836; CHECK-ARMV7-NEXT: ldrd r0, r1, [r0] 837; CHECK-ARMV7-NEXT: strd r0, r1, [r2] 838; CHECK-ARMV7-NEXT: bx lr 839; 840; CHECK-ARMV7-STRICT-LABEL: test_offset_4: 841; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 842; CHECK-ARMV7-STRICT-NEXT: movw r0, :lower16:x 843; CHECK-ARMV7-STRICT-NEXT: movw r2, :lower16:y 844; CHECK-ARMV7-STRICT-NEXT: movt r0, :upper16:x 845; CHECK-ARMV7-STRICT-NEXT: movt r2, :upper16:y 846; CHECK-ARMV7-STRICT-NEXT: add r0, r0, #1024 847; CHECK-ARMV7-STRICT-NEXT: add r2, r2, #1024 848; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [r0] 849; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [r2] 850; CHECK-ARMV7-STRICT-NEXT: bx lr 851; 852; CHECK-ARMV6-LABEL: test_offset_4: 853; CHECK-ARMV6: @ %bb.0: @ %entry 854; CHECK-ARMV6-NEXT: ldr r0, .LCPI7_0 855; CHECK-ARMV6-NEXT: ldr r2, .LCPI7_1 856; CHECK-ARMV6-NEXT: add r0, r0, #1024 857; CHECK-ARMV6-NEXT: add r2, r2, #1024 858; CHECK-ARMV6-NEXT: ldrd r0, r1, [r0] 859; CHECK-ARMV6-NEXT: strd r0, r1, [r2] 860; CHECK-ARMV6-NEXT: bx lr 861; CHECK-ARMV6-NEXT: .p2align 2 862; CHECK-ARMV6-NEXT: @ %bb.1: 863; CHECK-ARMV6-NEXT: .LCPI7_0: 864; CHECK-ARMV6-NEXT: .long x 865; CHECK-ARMV6-NEXT: .LCPI7_1: 866; CHECK-ARMV6-NEXT: .long y 867; 868; CHECK-ARMV6-STRICT-LABEL: test_offset_4: 869; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 870; CHECK-ARMV6-STRICT-NEXT: ldr r0, .LCPI7_0 871; CHECK-ARMV6-STRICT-NEXT: ldr r2, .LCPI7_1 872; CHECK-ARMV6-STRICT-NEXT: add r0, r0, #1024 873; CHECK-ARMV6-STRICT-NEXT: add r2, r2, #1024 874; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [r0] 875; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [r2] 876; CHECK-ARMV6-STRICT-NEXT: bx lr 877; CHECK-ARMV6-STRICT-NEXT: .p2align 2 878; CHECK-ARMV6-STRICT-NEXT: @ %bb.1: 879; CHECK-ARMV6-STRICT-NEXT: .LCPI7_0: 880; CHECK-ARMV6-STRICT-NEXT: .long x 881; CHECK-ARMV6-STRICT-NEXT: .LCPI7_1: 882; CHECK-ARMV6-STRICT-NEXT: .long y 883 884entry: 885 %0 = load volatile i64, ptr getelementptr (i8, ptr @x, i32 1024), align 8 886 store volatile i64 %0, ptr getelementptr (i8, ptr @y, i32 1024), align 8 887 ret void 888} 889 890define i64 @test_stack() { 891; CHECK-ARMV5TE-LABEL: test_stack: 892; CHECK-ARMV5TE: @ %bb.0: @ %entry 893; CHECK-ARMV5TE-NEXT: .pad #80 894; CHECK-ARMV5TE-NEXT: sub sp, sp, #80 895; CHECK-ARMV5TE-NEXT: mov r1, #0 896; CHECK-ARMV5TE-NEXT: mov r0, #1 897; CHECK-ARMV5TE-NEXT: strd r0, r1, [sp, #8] 898; CHECK-ARMV5TE-NEXT: ldrd r0, r1, [sp, #8] 899; CHECK-ARMV5TE-NEXT: add sp, sp, #80 900; CHECK-ARMV5TE-NEXT: bx lr 901; 902; CHECK-T2-LABEL: test_stack: 903; CHECK-T2: @ %bb.0: @ %entry 904; CHECK-T2-NEXT: .pad #80 905; CHECK-T2-NEXT: sub sp, #80 906; CHECK-T2-NEXT: movs r0, #0 907; CHECK-T2-NEXT: movs r1, #1 908; CHECK-T2-NEXT: strd r1, r0, [sp, #8] 909; CHECK-T2-NEXT: ldrd r0, r1, [sp, #8] 910; CHECK-T2-NEXT: add sp, #80 911; CHECK-T2-NEXT: bx lr 912; 913; CHECK-ARMV4T-LABEL: test_stack: 914; CHECK-ARMV4T: @ %bb.0: @ %entry 915; CHECK-ARMV4T-NEXT: .pad #80 916; CHECK-ARMV4T-NEXT: sub sp, sp, #80 917; CHECK-ARMV4T-NEXT: mov r0, #0 918; CHECK-ARMV4T-NEXT: str r0, [sp, #12] 919; CHECK-ARMV4T-NEXT: mov r0, #1 920; CHECK-ARMV4T-NEXT: str r0, [sp, #8] 921; CHECK-ARMV4T-NEXT: ldr r0, [sp, #8] 922; CHECK-ARMV4T-NEXT: ldr r1, [sp, #12] 923; CHECK-ARMV4T-NEXT: add sp, sp, #80 924; CHECK-ARMV4T-NEXT: bx lr 925; 926; CHECK-ARMV7-LABEL: test_stack: 927; CHECK-ARMV7: @ %bb.0: @ %entry 928; CHECK-ARMV7-NEXT: .pad #80 929; CHECK-ARMV7-NEXT: sub sp, sp, #80 930; CHECK-ARMV7-NEXT: mov r1, #0 931; CHECK-ARMV7-NEXT: mov r0, #1 932; CHECK-ARMV7-NEXT: strd r0, r1, [sp, #8] 933; CHECK-ARMV7-NEXT: ldrd r0, r1, [sp, #8] 934; CHECK-ARMV7-NEXT: add sp, sp, #80 935; CHECK-ARMV7-NEXT: bx lr 936; 937; CHECK-ARMV7-STRICT-LABEL: test_stack: 938; CHECK-ARMV7-STRICT: @ %bb.0: @ %entry 939; CHECK-ARMV7-STRICT-NEXT: .pad #80 940; CHECK-ARMV7-STRICT-NEXT: sub sp, sp, #80 941; CHECK-ARMV7-STRICT-NEXT: mov r1, #0 942; CHECK-ARMV7-STRICT-NEXT: mov r0, #1 943; CHECK-ARMV7-STRICT-NEXT: strd r0, r1, [sp, #8] 944; CHECK-ARMV7-STRICT-NEXT: ldrd r0, r1, [sp, #8] 945; CHECK-ARMV7-STRICT-NEXT: add sp, sp, #80 946; CHECK-ARMV7-STRICT-NEXT: bx lr 947; 948; CHECK-ARMV6-LABEL: test_stack: 949; CHECK-ARMV6: @ %bb.0: @ %entry 950; CHECK-ARMV6-NEXT: .pad #80 951; CHECK-ARMV6-NEXT: sub sp, sp, #80 952; CHECK-ARMV6-NEXT: mov r1, #0 953; CHECK-ARMV6-NEXT: mov r0, #1 954; CHECK-ARMV6-NEXT: strd r0, r1, [sp, #8] 955; CHECK-ARMV6-NEXT: ldrd r0, r1, [sp, #8] 956; CHECK-ARMV6-NEXT: add sp, sp, #80 957; CHECK-ARMV6-NEXT: bx lr 958; 959; CHECK-ARMV6-STRICT-LABEL: test_stack: 960; CHECK-ARMV6-STRICT: @ %bb.0: @ %entry 961; CHECK-ARMV6-STRICT-NEXT: .pad #80 962; CHECK-ARMV6-STRICT-NEXT: sub sp, sp, #80 963; CHECK-ARMV6-STRICT-NEXT: mov r1, #0 964; CHECK-ARMV6-STRICT-NEXT: mov r0, #1 965; CHECK-ARMV6-STRICT-NEXT: strd r0, r1, [sp, #8] 966; CHECK-ARMV6-STRICT-NEXT: ldrd r0, r1, [sp, #8] 967; CHECK-ARMV6-STRICT-NEXT: add sp, sp, #80 968; CHECK-ARMV6-STRICT-NEXT: bx lr 969 970entry: 971 %a = alloca [10 x i64], align 8 972 %arrayidx = getelementptr inbounds [10 x i64], ptr %a, i32 0, i32 1 973 store volatile i64 1, ptr %arrayidx, align 8 974 %arrayidx1 = getelementptr inbounds [10 x i64], ptr %a, i32 0, i32 1 975 %0 = load volatile i64, ptr %arrayidx1, align 8 976 ret i64 %0 977} 978 979