Skip to content

Commit ca6337f

Browse files
authored
Resolve most differences between amd-staging and main in llvm/lib/Target (llvm#3543)
2 parents 14dcf62 + 37a1024 commit ca6337f

File tree

9 files changed

+15
-26
lines changed

9 files changed

+15
-26
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10425,7 +10425,6 @@ SDValue AArch64TargetLowering::LowerGlobalTLSAddress(SDValue Op,
1042510425
llvm_unreachable("Unexpected platform trying to use TLS");
1042610426
}
1042710427

10428-
1042910428
//===----------------------------------------------------------------------===//
1043010429
// PtrAuthGlobalAddress lowering
1043110430
//

llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ void PPCInstPrinter::printAbsBranchOperand(const MCInst *MI, unsigned OpNo,
492492

493493
void PPCInstPrinter::printcrbitm(const MCInst *MI, unsigned OpNo,
494494
const MCSubtargetInfo &STI, raw_ostream &O) {
495-
unsigned CCReg = MI->getOperand(OpNo).getReg();
495+
MCRegister CCReg = MI->getOperand(OpNo).getReg();
496496
unsigned RegNo;
497-
switch (CCReg) {
497+
switch (CCReg.id()) {
498498
default: llvm_unreachable("Unknown CR register");
499499
case PPC::CR0: RegNo = 0; break;
500500
case PPC::CR1: RegNo = 1; break;
@@ -648,7 +648,7 @@ void PPCInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
648648
const MCSubtargetInfo &STI, raw_ostream &O) {
649649
const MCOperand &Op = MI->getOperand(OpNo);
650650
if (Op.isReg()) {
651-
unsigned Reg = Op.getReg();
651+
MCRegister Reg = Op.getReg();
652652
if (!ShowVSRNumsAsVR)
653653
Reg = PPC::getRegNumForOperand(MII.get(MI->getOpcode()), Reg, OpNo);
654654

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO,
485485
MI.getOpcode() != PPC::MFOCRF && MI.getOpcode() != PPC::MFOCRF8) ||
486486
MO.getReg() < PPC::CR0 || MO.getReg() > PPC::CR7);
487487
unsigned OpNo = getOpIdxForMO(MI, MO);
488-
unsigned Reg =
488+
MCRegister Reg =
489489
PPC::getRegNumForOperand(MCII.get(MI.getOpcode()), MO.getReg(), OpNo);
490490
return CTX.getRegisterInfo()->getEncodingValue(Reg);
491491
}

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ const char *PPC::stripRegisterPrefix(const char *RegName) {
119119
/// The operand number argument will be useful when we need to extend this
120120
/// to instructions that use both Altivec and VSX numbering (for different
121121
/// operands).
122-
unsigned PPC::getRegNumForOperand(const MCInstrDesc &Desc, unsigned Reg,
123-
unsigned OpNo) {
122+
MCRegister PPC::getRegNumForOperand(const MCInstrDesc &Desc, MCRegister Reg,
123+
unsigned OpNo) {
124124
int16_t regClass = Desc.operands()[OpNo].RegClass;
125125
switch (regClass) {
126126
// We store F0-F31, VF0-VF31 in MCOperand and it should be F0-F31,

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const char *stripRegisterPrefix(const char *RegName);
4747
/// The operand number argument will be useful when we need to extend this
4848
/// to instructions that use both Altivec and VSX numbering (for different
4949
/// operands).
50-
unsigned getRegNumForOperand(const MCInstrDesc &Desc, unsigned Reg,
51-
unsigned OpNo);
50+
MCRegister getRegNumForOperand(const MCInstrDesc &Desc, MCRegister Reg,
51+
unsigned OpNo);
5252

5353
} // namespace PPC
5454

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
987987
// Get the offset from the GOT Base Register to the GOT
988988
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
989989
if (Subtarget->isSecurePlt() && isPositionIndependent() ) {
990-
unsigned PICR = TmpInst.getOperand(0).getReg();
990+
MCRegister PICR = TmpInst.getOperand(0).getReg();
991991
MCSymbol *BaseSymbol = OutContext.getOrCreateSymbol(
992992
M->getPICLevel() == PICLevel::SmallPIC ? "_GLOBAL_OFFSET_TABLE_"
993993
: ".LTOC");

llvm/lib/Target/PowerPC/PPCFrameLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static bool hasNonRISpills(const MachineFunction &MF) {
267267
/// MustSaveLR - Return true if this function requires that we save the LR
268268
/// register onto the stack in the prolog and restore it in the epilog of the
269269
/// function.
270-
static bool MustSaveLR(const MachineFunction &MF, unsigned LR) {
270+
static bool MustSaveLR(const MachineFunction &MF, MCRegister LR) {
271271
const PPCFunctionInfo *MFI = MF.getInfo<PPCFunctionInfo>();
272272

273273
// We need a save/restore of LR if there is any def of LR (which is
@@ -311,7 +311,7 @@ PPCFrameLowering::determineFrameLayout(const MachineFunction &MF,
311311

312312
const PPCRegisterInfo *RegInfo = Subtarget.getRegisterInfo();
313313

314-
unsigned LR = RegInfo->getRARegister();
314+
MCRegister LR = RegInfo->getRARegister();
315315
bool DisableRedZone = MF.getFunction().hasFnAttribute(Attribute::NoRedZone);
316316
bool CanUseRedZone = !MFI.hasVarSizedObjects() && // No dynamic alloca.
317317
!MFI.adjustsStack() && // No calls.
@@ -1987,7 +1987,7 @@ void PPCFrameLowering::determineCalleeSaves(MachineFunction &MF,
19871987

19881988
// Save and clear the LR state.
19891989
PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
1990-
unsigned LR = RegInfo->getRARegister();
1990+
MCRegister LR = RegInfo->getRARegister();
19911991
FI->setMustSaveLR(MustSaveLR(MF, LR));
19921992
SavedRegs.reset(LR);
19931993

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,11 +3310,6 @@ InstructionCost X86TTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst,
33103310
TTI::CastContextHint::None, CostKind);
33113311
}
33123312

3313-
if (ISD == ISD::FP_ROUND && LTDest.second.getScalarType() == MVT::f16) {
3314-
// Conversion requires a libcall.
3315-
return InstructionCost::getInvalid();
3316-
}
3317-
33183313
// TODO: Allow non-throughput costs that aren't binary.
33193314
auto AdjustCost = [&CostKind](InstructionCost Cost,
33203315
InstructionCost N = 1) -> InstructionCost {

llvm/test/Transforms/SLPVectorizer/X86/conversion-fp16.ll

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,9 @@ define void @fpround_v16xf32_v16xf16(ptr %s0, ptr %d0) {
453453
;
454454
; CHECK-F16C-LABEL: define void @fpround_v16xf32_v16xf16(
455455
; CHECK-F16C-SAME: ptr [[S0:%.*]], ptr [[D0:%.*]]) #[[ATTR0]] {
456-
; CHECK-F16C-NEXT: [[S8:%.*]] = getelementptr inbounds float, ptr [[S0]], i64 8
457-
; CHECK-F16C-NEXT: [[D8:%.*]] = getelementptr inbounds half, ptr [[D0]], i64 8
458-
; CHECK-F16C-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr [[S0]], align 4
459-
; CHECK-F16C-NEXT: [[TMP2:%.*]] = fptrunc <8 x float> [[TMP1]] to <8 x half>
460-
; CHECK-F16C-NEXT: [[TMP3:%.*]] = load <8 x float>, ptr [[S8]], align 4
461-
; CHECK-F16C-NEXT: [[TMP4:%.*]] = fptrunc <8 x float> [[TMP3]] to <8 x half>
462-
; CHECK-F16C-NEXT: store <8 x half> [[TMP2]], ptr [[D0]], align 2
463-
; CHECK-F16C-NEXT: store <8 x half> [[TMP4]], ptr [[D8]], align 2
456+
; CHECK-F16C-NEXT: [[TMP1:%.*]] = load <16 x float>, ptr [[S0]], align 4
457+
; CHECK-F16C-NEXT: [[TMP2:%.*]] = fptrunc <16 x float> [[TMP1]] to <16 x half>
458+
; CHECK-F16C-NEXT: store <16 x half> [[TMP2]], ptr [[D0]], align 2
464459
; CHECK-F16C-NEXT: ret void
465460
;
466461
; CHECK-AVX512-LABEL: define void @fpround_v16xf32_v16xf16(

0 commit comments

Comments
 (0)