1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -passes=alignment-from-assumptions -S < %s | FileCheck %s
4 ; The alignment assumption is a global, which has users in a different
5 ; function. Test that in this case the dominator tree is only queried with
6 ; blocks from the same function.
8 @global = external constant [192 x i8]
11 ; CHECK-LABEL: define void @fn1() {
12 ; CHECK-NEXT: call void @llvm.assume(i1 false) [ "align"(ptr @global, i64 1) ]
13 ; CHECK-NEXT: ret void
15 call void @llvm.assume(i1 false) [ "align"(ptr @global, i64 1) ]
20 ; CHECK-LABEL: define void @fn2() {
21 ; CHECK-NEXT: ret void
23 ; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr @global, i64 0
24 ; CHECK-NEXT: [[LOAD:%.*]] = load i64, ptr [[GEP]], align 1
25 ; CHECK-NEXT: br label %[[LOOP]]
30 %gep = getelementptr inbounds i8, ptr @global, i64 0
31 %load = load i64, ptr %gep, align 1