Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,13 +847,7 @@ static bool isSupportedInstr(const MachineInstr &MI) {
case RISCV::VLUXEI32_V:
case RISCV::VLOXEI32_V:
case RISCV::VLUXEI64_V:
case RISCV::VLOXEI64_V: {
for (const MachineMemOperand *MMO : MI.memoperands())
if (MMO->isVolatile())
return false;
return true;
}

case RISCV::VLOXEI64_V:
// Vector Single-Width Integer Add and Subtract
case RISCV::VADD_VI:
case RISCV::VADD_VV:
Expand Down Expand Up @@ -1292,6 +1286,13 @@ bool RISCVVLOptimizer::isCandidate(const MachineInstr &MI) const {
return false;
}

for (const MachineMemOperand *MMO : MI.memoperands()) {
if (MMO->isVolatile()) {
LLVM_DEBUG(dbgs() << "Not a candidate because contains volatile MMO\n");
return false;
}
}

// Some instructions that produce vectors have semantics that make it more
// difficult to determine whether the VL can be reduced. For example, some
// instructions, such as reductions, may write lanes past VL to a scalar
Expand Down