1; RUN: llc < %s | FileCheck %s 2; RUN: llc -relocation-model=pic < %s | FileCheck %s 3 4target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 5target triple = "x86_64-unknown-linux-gnu" 6 7@align = external hidden global i8, !absolute_symbol !0 8 9declare void @f() 10 11define void @foo(i64 %val) { 12 %shr = lshr i64 %val, zext (i8 ptrtoint (i8* @align to i8) to i64) 13 %shl = shl i64 %val, zext (i8 sub (i8 64, i8 ptrtoint (i8* @align to i8)) to i64) 14 ; CHECK: rorq $align@ABS8, %rdi 15 %ror = or i64 %shr, %shl 16 %cmp = icmp ult i64 %ror, 109 17 br i1 %cmp, label %t, label %f 18 19t: 20 call void @f() 21 ret void 22 23f: 24 ret void 25} 26 27define void @bar(i64 %val) { 28 %shr = shl i64 %val, zext (i8 ptrtoint (i8* @align to i8) to i64) 29 %shl = lshr i64 %val, zext (i8 sub (i8 64, i8 ptrtoint (i8* @align to i8)) to i64) 30 ; CHECK: rolq $align@ABS8, %rdi 31 %rol = or i64 %shr, %shl 32 %cmp = icmp ult i64 %rol, 109 33 br i1 %cmp, label %t, label %f 34 35t: 36 call void @f() 37 ret void 38 39f: 40 ret void 41} 42 43!0 = !{i64 0, i64 128} 44