Skip to content

Commit 91e1922

Browse files
committed
[DSE] Skip non-pointer args in initializes handling (NFCI)
Avoid performing AA queries on non-pointers.
1 parent 6d0d50f commit 91e1922

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -2334,14 +2334,17 @@ DSEState::getInitializesArgMemLoc(const Instruction *I) {
23342334
// Collect aliasing arguments and their initializes ranges.
23352335
SmallMapVector<Value *, SmallVector<ArgumentInitInfo, 2>, 2> Arguments;
23362336
for (unsigned Idx = 0, Count = CB->arg_size(); Idx < Count; ++Idx) {
2337+
Value *CurArg = CB->getArgOperand(Idx);
2338+
if (!CurArg->getType()->isPointerTy())
2339+
continue;
2340+
23372341
ConstantRangeList Inits;
23382342
Attribute InitializesAttr = CB->getParamAttr(Idx, Attribute::Initializes);
23392343
// initializes on byval arguments refers to the callee copy, not the
23402344
// original memory the caller passed in.
23412345
if (InitializesAttr.isValid() && !CB->isByValArgument(Idx))
23422346
Inits = InitializesAttr.getValueAsConstantRangeList();
23432347

2344-
Value *CurArg = CB->getArgOperand(Idx);
23452348
// Check whether "CurArg" could alias with global variables. We require
23462349
// either it's function local and isn't captured before or the "CB" only
23472350
// accesses arg or inaccessible mem.

0 commit comments

Comments
 (0)