Skip to content

Commit 29181bd

Browse files
committed
Revert "[RISCV] Use a switch instead of a series of if-clauses [nfc]"
This reverts commit 3c2203a. The buildbots were quick to remind me that I had, in fact, missed a switch case. Oops.
1 parent 0a8f54c commit 29181bd

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -301,21 +301,18 @@ inline raw_ostream &operator<<(raw_ostream &OS, const DemandedFields &DF) {
301301
/// of instructions) which use only the Used subfields and properties.
302302
static bool areCompatibleVTYPEs(uint64_t CurVType, uint64_t NewVType,
303303
const DemandedFields &Used) {
304-
switch (Used.SEW) {
305-
case DemandedFields::SEWEqual:
306-
if (RISCVVType::getSEW(CurVType) != RISCVVType::getSEW(NewVType))
307-
return false;
308-
break;
309-
case DemandedFields::SEWGreaterThanOrEqual:
310-
if (RISCVVType::getSEW(NewVType) < RISCVVType::getSEW(CurVType))
311-
return false;
312-
break;
313-
case DemandedFields::SEWGreaterThanOrEqualAndLessThan64:
314-
if (RISCVVType::getSEW(NewVType) < RISCVVType::getSEW(CurVType) ||
315-
RISCVVType::getSEW(NewVType) >= 64)
316-
return false;
317-
break;
318-
}
304+
if (Used.SEW == DemandedFields::SEWEqual &&
305+
RISCVVType::getSEW(CurVType) != RISCVVType::getSEW(NewVType))
306+
return false;
307+
308+
if (Used.SEW == DemandedFields::SEWGreaterThanOrEqual &&
309+
RISCVVType::getSEW(NewVType) < RISCVVType::getSEW(CurVType))
310+
return false;
311+
312+
if (Used.SEW == DemandedFields::SEWGreaterThanOrEqualAndLessThan64 &&
313+
(RISCVVType::getSEW(NewVType) < RISCVVType::getSEW(CurVType) ||
314+
RISCVVType::getSEW(NewVType) >= 64))
315+
return false;
319316

320317
if (Used.LMUL &&
321318
RISCVVType::getVLMUL(CurVType) != RISCVVType::getVLMUL(NewVType))

0 commit comments

Comments
 (0)