[FastISel] Remove redundant reg class check (NFC)

SrcVT and DstVT are the same in this branch, as such their register
classes will also be the same.
This commit is contained in:
Nikita Popov 2022-02-10 14:09:00 +01:00
parent ff5a9c3c65
commit 6241f7dee0
1 changed files with 3 additions and 8 deletions

View File

@ -1434,14 +1434,9 @@ bool FastISel::selectBitCast(const User *I) {
// First, try to perform the bitcast by inserting a reg-reg copy.
Register ResultReg;
if (SrcVT == DstVT) {
const TargetRegisterClass *SrcClass = TLI.getRegClassFor(SrcVT);
const TargetRegisterClass *DstClass = TLI.getRegClassFor(DstVT);
// Don't attempt a cross-class copy. It will likely fail.
if (SrcClass == DstClass) {
ResultReg = createResultReg(DstClass);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
TII.get(TargetOpcode::COPY), ResultReg).addReg(Op0);
}
ResultReg = createResultReg(TLI.getRegClassFor(DstVT));
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
TII.get(TargetOpcode::COPY), ResultReg).addReg(Op0);
}
// If the reg-reg copy failed, select a BITCAST opcode.