Skip to content

Commit 8ea5ac2

Browse files
committed
[DirectX] Simplify load processing in DXILLegalize
This is a small cleanup based on post-commit review of llvm#172921 See https://github.com/llvm/llvm-project/pull/172921/changes#r2635381097
1 parent 39b24e8 commit 8ea5ac2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

llvm/lib/Target/DirectX/DXILLegalizePass.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,10 @@ static bool upcastI8AllocasAndUses(Instruction &I,
265265

266266
auto ProcessLoad = [&](LoadInst *Load) {
267267
for (User *LU : Load->users()) {
268-
Type *Ty = nullptr;
269-
if (CastInst *Cast = dyn_cast<CastInst>(LU))
270-
Ty = Cast->getType();
271-
else if (CallInst *CI = dyn_cast<CallInst>(LU)) {
272-
assert(CI->getIntrinsicID() != Intrinsic::memset &&
273-
"memset should have been eliminated in an earlier pass");
274-
}
275-
276-
if (!Ty)
268+
CastInst *Cast = dyn_cast<CastInst>(LU);
269+
if (!Cast)
277270
continue;
271+
Type *Ty = Cast->getType();
278272

279273
if (!SmallestType ||
280274
Ty->getPrimitiveSizeInBits() < SmallestType->getPrimitiveSizeInBits())

0 commit comments

Comments
 (0)