summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-09-15 10:09:59 +0000
committerTim Northover <tnorthover@apple.com>2016-09-15 10:09:59 +0000
commit32a078ad1a60eb2bc838d7bd341edefb0c0179d1 (patch)
tree57525d0678415a813b4363d97922a2e82b152b5c /llvm/lib/Target
parent6a5bac48cf9a033b4c8e974d95bbd2217a151635 (diff)
downloadbcm5719-llvm-32a078ad1a60eb2bc838d7bd341edefb0c0179d1.tar.gz
bcm5719-llvm-32a078ad1a60eb2bc838d7bd341edefb0c0179d1.zip
GlobalISel: remove "unsized" LLT
It was only really there as a sentinel when instructions had to have precisely one type. Now that registers are typed, each register really has to have a type that is sized. llvm-svn: 281599
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp9
-rw-r--r--llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp1
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp2
3 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
index e45d718c2b0..efb2dbc64a9 100644
--- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -50,8 +50,8 @@ static bool unsupportedBinOp(const MachineInstr &I,
const MachineRegisterInfo &MRI,
const AArch64RegisterInfo &TRI) {
LLT Ty = MRI.getType(I.getOperand(0).getReg());
- if (!Ty.isSized()) {
- DEBUG(dbgs() << "Generic binop should be sized\n");
+ if (!Ty.isValid()) {
+ DEBUG(dbgs() << "Generic binop register should be typed\n");
return true;
}
@@ -220,9 +220,8 @@ bool AArch64InstructionSelector::select(MachineInstr &I) const {
return false;
}
- const LLT Ty = I.getOperand(0).isReg() ? MRI.getType(I.getOperand(0).getReg())
- : LLT::unsized();
- assert(Ty.isValid() && "Generic instruction doesn't have a type");
+ LLT Ty =
+ I.getOperand(0).isReg() ? MRI.getType(I.getOperand(0).getReg()) : LLT{};
switch (I.getOpcode()) {
case TargetOpcode::G_BR: {
diff --git a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
index 13a2018ac58..e2165b58df5 100644
--- a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
@@ -149,7 +149,6 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
}
// Control-flow
- setAction({G_BR, LLT::unsized()}, Legal);
setAction({G_BRCOND, s32}, Legal);
for (auto Ty : {s1, s8, s16})
setAction({G_BRCOND, Ty}, WidenScalar);
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
index ac433db6b85..d0da232bdce 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
@@ -188,7 +188,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
BankID = AArch64::GPRRegBankID;
Mapping = InstructionMapping{1, 1, MI.getNumOperands()};
- int Size = Ty.isSized() ? Ty.getSizeInBits() : 0;
+ int Size = Ty.isValid() ? Ty.getSizeInBits() : 0;
for (unsigned Idx = 0; Idx < MI.getNumOperands(); ++Idx)
Mapping.setOperandMapping(Idx, Size, getRegBank(BankID));
OpenPOWER on IntegriCloud