Skip to content

Commit 7debc6d

Browse files
committed
Address comments
1 parent e5f74f2 commit 7debc6d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,6 @@ bool llvm::isValidAssumeForContext(const Instruction *Inv,
526526
return AllowEphemerals || !isEphemeralValueOf(Inv, CxtI);
527527
}
528528

529-
// Inv and CxtI are in different functions.
530-
if (Inv->getFunction() != CxtI->getFunction())
531-
return false;
532-
533529
// Inv and CxtI are in different blocks.
534530
if (DT) {
535531
if (DT->dominates(Inv, CxtI))

llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
208208
continue;
209209

210210
if (Instruction *K = dyn_cast<Instruction>(J))
211+
if (K->getFunction() == ACall->getFunction())
211212
WorkList.push_back(K);
212213
}
213214

@@ -267,6 +268,8 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
267268
for (auto &U : J->uses()) {
268269
if (U->getType()->isPointerTy()) {
269270
Instruction *K = cast<Instruction>(U.getUser());
271+
if (K->getFunction() != ACall->getFunction())
272+
continue;
270273
StoreInst *SI = dyn_cast<StoreInst>(K);
271274
if (SI && SI->getPointerOperandIndex() != U.getOperandNo())
272275
continue;

0 commit comments

Comments
 (0)