Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lld/ELF/Arch/AIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ uint32_t AIE::calcEFlags() const {

RelExpr AIE::getRelExpr(const RelType Type, const Symbol &S,
const uint8_t *Loc) const {
switch (Type) {
default:
return R_ABS;
}
return R_ABS;
}

// Read an N byte value from Loc in little-endian fashion.
Expand Down
39 changes: 19 additions & 20 deletions llvm/lib/Target/AIE/AIEInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ unsigned getVCMPforPseudoVCMP(unsigned opcode) {
case AIE::VCMP512_S8:
return AIE::VCMP_S8;
}
assert(false && "Illegal opcode");

llvm_unreachable("Illegal opcode");
}

SmallVector<AIEBaseInstrInfo::AIEPseudoExpandInfo, 4>
Expand Down Expand Up @@ -656,25 +657,23 @@ std::optional<unsigned> AIEInstrInfo::getCombinedPostIncOpcode(
unsigned AIEInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
unsigned Opcode = MI.getOpcode();

switch (Opcode) {
default: { return get(Opcode).getSize(); }
// case TargetOpcode::EH_LABEL:
// case TargetOpcode::IMPLICIT_DEF:
// case TargetOpcode::KILL:
// case TargetOpcode::DBG_VALUE:
// return 0;
// case AIE::PseudoCALL:
// case AIE::PseudoTAIL:
// case AIE::PseudoLLA:
// return 8;
// case TargetOpcode::INLINEASM:
// case TargetOpcode::INLINEASM_BR: {
// const MachineFunction &MF = *MI.getParent()->getParent();
// const auto &TM = static_cast<const AIETargetMachine &>(MF.getTarget());
// return getInlineAsmLength(MI.getOperand(0).getSymbolName(),
// *TM.getMCAsmInfo());
// }
}
return get(Opcode).getSize();
// case TargetOpcode::EH_LABEL:
// case TargetOpcode::IMPLICIT_DEF:
// case TargetOpcode::KILL:
// case TargetOpcode::DBG_VALUE:
// return 0;
// case AIE::PseudoCALL:
// case AIE::PseudoTAIL:
// case AIE::PseudoLLA:
// return 8;
// case TargetOpcode::INLINEASM:
// case TargetOpcode::INLINEASM_BR: {
// const MachineFunction &MF = *MI.getParent()->getParent();
// const auto &TM = static_cast<const AIETargetMachine &>(MF.getTarget());
// return getInlineAsmLength(MI.getOperand(0).getSymbolName(),
// *TM.getMCAsmInfo());
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the commented code?

}

std::pair<unsigned, unsigned>
Expand Down
5 changes: 1 addition & 4 deletions llvm/lib/Target/AIE/MCTargetDesc/AIEMCExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,5 @@ bool AIEMCExpr::evaluateAsConstant(int64_t &Res) const {
}

int64_t AIEMCExpr::evaluateAsInt64(int64_t Value) const {
switch (Kind) {
default:
llvm_unreachable("Invalid kind");
}
llvm_unreachable("Invalid kind");
}
5 changes: 0 additions & 5 deletions llvm/lib/Target/AIE/MCTargetDesc/aie2p/AIE2PAsmBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
using namespace llvm;

bool AIE2PAsmBackend::isCall(unsigned Opcode) const {
switch (Opcode) {
// TODO Add Call Opcode e.g. JL
default:
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this removes a TODO

return false;
}

Expand Down
20 changes: 14 additions & 6 deletions llvm/utils/TableGen/CodeGenFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,20 @@ void CodeGenFormat::run(raw_ostream &o) {
o << "const std::vector<unsigned int> *" << Target.getName().str()
<< "MCFormats::getAlternateInstsOpcode";
o << "(unsigned int Opcode) const {\n";
o << " switch (Opcode) {\n";
o << " default:\n";
o << " return nullptr;\n";
for (unsigned int i = 0; i < PseudoInstFormats.size(); i++)
PseudoInstFormats[i].emitAlternateInstsOpcode(o, i);
o << " }\n}\n";

if (!PseudoInstFormats.empty()) {

o << " switch (Opcode) {\n";
o << " default:\n";
o << " return nullptr;\n";
for (unsigned int i = 0; i < PseudoInstFormats.size(); i++)
PseudoInstFormats[i].emitAlternateInstsOpcode(o, i);
o << " }\n}\n";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This complicates the generator, while the code is correct. Can we disable these warnings in generated code?


} else {
o << " return nullptr;\n";
o << " }\n";
}
o << "#endif // GET_ALTERNATE_INST_OPCODE_FUNC\n\n";

if (InstFormats.size() > 0 && Slots.size() > 0) {
Expand Down
Loading