Skip to content

Commit

Permalink
Simplify swtich
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Jun 20, 2024
1 parent da0d76b commit a4310a6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions llvm/lib/Target/SBF/SBFInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void SBFInstrInfo::expandMEMCPY(MachineBasicBlock::iterator MI) const {
DebugLoc dl = MI->getDebugLoc();
unsigned LdOpc, StOpc;

unsigned BytesPerOp = Alignment;
unsigned BytesPerOp = std::min(static_cast<unsigned>(Alignment), 8u);
switch (Alignment) {
case 1:
LdOpc = SBF::LDB;
Expand All @@ -67,13 +67,9 @@ void SBFInstrInfo::expandMEMCPY(MachineBasicBlock::iterator MI) const {
StOpc = SBF::STW;
break;
case 8:
LdOpc = SBF::LDD;
StOpc = SBF::STD;
break;
case 16:
LdOpc = SBF::LDD;
StOpc = SBF::STD;
BytesPerOp = 8;
break;
default:
llvm_unreachable("unsupported memcpy alignment");
Expand Down

0 comments on commit a4310a6

Please sign in to comment.