Skip to content

Commit be63e6d

Browse files
committed
Address comments
1 parent f0305cd commit be63e6d

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,6 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
268268
for (auto &U : J->uses()) {
269269
if (U->getType()->isPointerTy()) {
270270
Instruction *K = cast<Instruction>(U.getUser());
271-
if (K->getFunction() != ACall->getFunction())
272-
continue;
273271
StoreInst *SI = dyn_cast<StoreInst>(K);
274272
if (SI && SI->getPointerOperandIndex() != U.getOperandNo())
275273
continue;

llvm/test/Transforms/AlignmentFromAssumptions/domtree-crash.ll

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
; RUN: opt -passes=alignment-from-assumptions -disable-output < %s
2-
3-
; REQUIRES: asserts
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
43

54
; The alignment assumption is a global, which has users in a different
65
; function. Test that in this case the dominator tree is only queried with
76
; blocks from the same function.
87

9-
target triple = "x86_64-unknown-linux-gnu"
10-
118
@global = external constant [192 x i8]
129

1310
define void @fn1() {
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
14+
;
1415
call void @llvm.assume(i1 false) [ "align"(ptr @global, i64 1) ]
1516
ret void
1617
}
1718

1819
define void @fn2() {
20+
; CHECK-LABEL: define void @fn2() {
21+
; CHECK-NEXT: ret void
22+
; CHECK: [[LOOP:.*]]:
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]]
26+
;
1927
ret void
2028

2129
loop:

0 commit comments

Comments
 (0)