summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index 6adb7ddb5b66..4b6c3a156709 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -126,7 +126,7 @@ static bool mutationIsSane(const LegalizeRule &Rule,
case FewerElements:
if (!OldTy.isVector())
return false;
- LLVM_FALLTHROUGH;
+ [[fallthrough]];
case MoreElements: {
// MoreElements can go from scalar to vector.
const ElementCount OldElts = OldTy.isVector() ?
@@ -296,7 +296,7 @@ LegalizeRuleSet &LegalizerInfo::getActionDefinitionsBuilder(
std::initializer_list<unsigned> Opcodes) {
unsigned Representative = *Opcodes.begin();
- assert(!llvm::empty(Opcodes) && Opcodes.begin() + 1 != Opcodes.end() &&
+ assert(Opcodes.size() >= 2 &&
"Initializer list must have at least two opcodes");
for (unsigned Op : llvm::drop_begin(Opcodes))
@@ -330,7 +330,7 @@ LegalizerInfo::getAction(const MachineInstr &MI,
const MachineRegisterInfo &MRI) const {
SmallVector<LLT, 8> Types;
SmallBitVector SeenTypes(8);
- const MCOperandInfo *OpInfo = MI.getDesc().OpInfo;
+ ArrayRef<MCOperandInfo> OpInfo = MI.getDesc().operands();
// FIXME: probably we'll need to cache the results here somehow?
for (unsigned i = 0; i < MI.getDesc().getNumOperands(); ++i) {
if (!OpInfo[i].isGenericType())
@@ -379,14 +379,14 @@ void LegalizerInfo::verify(const MCInstrInfo &MII) const {
for (unsigned Opcode = FirstOp; Opcode <= LastOp; ++Opcode) {
const MCInstrDesc &MCID = MII.get(Opcode);
const unsigned NumTypeIdxs = std::accumulate(
- MCID.opInfo_begin(), MCID.opInfo_end(), 0U,
+ MCID.operands().begin(), MCID.operands().end(), 0U,
[](unsigned Acc, const MCOperandInfo &OpInfo) {
return OpInfo.isGenericType()
? std::max(OpInfo.getGenericTypeIndex() + 1U, Acc)
: Acc;
});
const unsigned NumImmIdxs = std::accumulate(
- MCID.opInfo_begin(), MCID.opInfo_end(), 0U,
+ MCID.operands().begin(), MCID.operands().end(), 0U,
[](unsigned Acc, const MCOperandInfo &OpInfo) {
return OpInfo.isGenericImm()
? std::max(OpInfo.getGenericImmIndex() + 1U, Acc)