[PATCH] D87340: [EarlyCSE] Handle masked loads and stores
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 14:00:04 PDT 2020
efriedma requested changes to this revision.
efriedma added inline comments.
This revision now requires changes to proceed.
================
Comment at: llvm/lib/Transforms/Scalar/EarlyCSE.cpp:883
+ for (int i = 0, e = Vec0->getNumOperands(); i != e; ++i) {
+ bool M0 = cast<ConstantInt>(Vec0->getOperand(i))->getZExtValue();
+ bool M1 = cast<ConstantInt>(Vec1->getOperand(i))->getZExtValue();
----------------
Just spotted an issue here.
This `cast<ConstantInt>` could fail. The operand of a ConstantVector has to be a Constant, but it doesn't have to be a ConstantInt. It could be an UndefValue, or a ConstantExpr.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87340/new/
https://reviews.llvm.org/D87340
More information about the llvm-commits
mailing list