Skip to content

Commit 07c4290

Browse files
committed
Skip for Intrinsics and correct poitners
1 parent 0778e2e commit 07c4290

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3266,13 +3266,26 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
32663266
}
32673267
if (auto *SI = dyn_cast<StoreInst>(Curr)) {
32683268
auto *PtrOpI = dyn_cast<Instruction>(SI->getPointerOperand());
3269-
if (PtrOpI && WorkList.contains(PtrOpI) &&
3269+
if ((SI->getPointerOperand() == RK.WasOn || (PtrOpI && WorkList.contains(PtrOpI))) &&
32703270
SI->getAlign().value() < RK.ArgValue) {
32713271
CanUseAlign = true;
32723272
break;
32733273
}
32743274
continue;
32753275
}
3276+
if (auto *II = dyn_cast<IntrinsicInst>(Curr)) {
3277+
for (const auto &[Idx, Arg] : enumerate(II->args())) {
3278+
if (Arg != RK.WasOn)
3279+
continue;
3280+
if (II->getParamAlign(Idx) >= RK.ArgValue)
3281+
continue;
3282+
CanUseAlign = true;
3283+
break;
3284+
}
3285+
if (CanUseAlign)
3286+
break;
3287+
continue;
3288+
}
32763289
if (isa<ReturnInst, CallBase>(Curr)) {
32773290
CanUseAlign = true;
32783291
break;

0 commit comments

Comments
 (0)