[llvm] [ARM][X86][NFC] Use lambda to avoid duplicate switches in areLoadsFromSameBasePtr (PR #72376)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 04:33:27 PST 2023
================
@@ -1953,46 +1953,32 @@ bool ARMBaseInstrInfo::areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2,
if (!Load1->isMachineOpcode() || !Load2->isMachineOpcode())
return false;
- switch (Load1->getMachineOpcode()) {
- default:
- return false;
- case ARM::LDRi12:
- case ARM::LDRBi12:
- case ARM::LDRD:
- case ARM::LDRH:
- case ARM::LDRSB:
- case ARM::LDRSH:
- case ARM::VLDRD:
- case ARM::VLDRS:
- case ARM::t2LDRi8:
- case ARM::t2LDRBi8:
- case ARM::t2LDRDi8:
- case ARM::t2LDRSHi8:
- case ARM::t2LDRi12:
- case ARM::t2LDRBi12:
- case ARM::t2LDRSHi12:
- break;
- }
+ auto IsLoadOpcode = [&](unsigned Opcode) {
+ switch (Load1->getMachineOpcode()) {
----------------
davemgreen wrote:
It looks like this should be Opcode
https://github.com/llvm/llvm-project/pull/72376
More information about the llvm-commits
mailing list