diff --git a/llvm/lib/Target/Lanai/LanaiAluCode.h b/llvm/lib/Target/Lanai/LanaiAluCode.h index 69be05542723..0494dda459bd 100644 --- a/llvm/lib/Target/Lanai/LanaiAluCode.h +++ b/llvm/lib/Target/Lanai/LanaiAluCode.h @@ -14,7 +14,6 @@ #define LLVM_LIB_TARGET_LANAI_LANAIALUCODE_H #include "llvm/ADT/StringSwitch.h" -#include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/Support/ErrorHandling.h" namespace llvm { @@ -114,33 +113,6 @@ inline static AluCode stringToLanaiAluCode(StringRef S) { .Case("sha", SRA) .Default(UNKNOWN); } - -inline static AluCode isdToLanaiAluCode(ISD::NodeType Node_type) { - switch (Node_type) { - case ISD::ADD: - return AluCode::ADD; - case ISD::ADDE: - return AluCode::ADDC; - case ISD::SUB: - return AluCode::SUB; - case ISD::SUBE: - return AluCode::SUBB; - case ISD::AND: - return AluCode::AND; - case ISD::OR: - return AluCode::OR; - case ISD::XOR: - return AluCode::XOR; - case ISD::SHL: - return AluCode::SHL; - case ISD::SRL: - return AluCode::SRL; - case ISD::SRA: - return AluCode::SRA; - default: - return AluCode::UNKNOWN; - } -} } // namespace LPAC } // namespace llvm diff --git a/llvm/lib/Target/Lanai/LanaiISelDAGToDAG.cpp b/llvm/lib/Target/Lanai/LanaiISelDAGToDAG.cpp index b1ecebe24b18..e0d73587ec1b 100644 --- a/llvm/lib/Target/Lanai/LanaiISelDAGToDAG.cpp +++ b/llvm/lib/Target/Lanai/LanaiISelDAGToDAG.cpp @@ -212,6 +212,37 @@ bool LanaiDAGToDAGISel::selectAddrSpls(SDValue Addr, SDValue &Base, return selectAddrRiSpls(Addr, Base, Offset, AluOp, /*RiMode=*/false); } +namespace llvm { +namespace LPAC { +static AluCode isdToLanaiAluCode(ISD::NodeType Node_type) { + switch (Node_type) { + case ISD::ADD: + return AluCode::ADD; + case ISD::ADDE: + return AluCode::ADDC; + case ISD::SUB: + return AluCode::SUB; + case ISD::SUBE: + return AluCode::SUBB; + case ISD::AND: + return AluCode::AND; + case ISD::OR: + return AluCode::OR; + case ISD::XOR: + return AluCode::XOR; + case ISD::SHL: + return AluCode::SHL; + case ISD::SRL: + return AluCode::SRL; + case ISD::SRA: + return AluCode::SRA; + default: + return AluCode::UNKNOWN; + } +} +} // namespace LPAC +} // namespace llvm + bool LanaiDAGToDAGISel::selectAddrRr(SDValue Addr, SDValue &R1, SDValue &R2, SDValue &AluOp) { // if Address is FI, get the TargetFrameIndex.