@@ -2498,6 +2498,25 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
24982498 MI.eraseFromParent ();
24992499 break ;
25002500 }
2501+ case AMDGPU::SI_PC_ADD_REL_OFFSET64: {
2502+ MachineFunction &MF = *MBB.getParent ();
2503+ Register Reg = MI.getOperand (0 ).getReg ();
2504+ MachineOperand Op = MI.getOperand (1 );
2505+
2506+ // Create a bundle so these instructions won't be re-ordered by the
2507+ // post-RA scheduler.
2508+ MIBundleBuilder Bundler (MBB, MI);
2509+ Bundler.append (BuildMI (MF, DL, get (AMDGPU::S_GETPC_B64), Reg));
2510+ if (Op.isGlobal ())
2511+ Op.setOffset (Op.getOffset () + 4 );
2512+ Bundler.append (
2513+ BuildMI (MF, DL, get (AMDGPU::S_ADD_U64), Reg).addReg (Reg).add (Op));
2514+
2515+ finalizeBundle (MBB, Bundler.begin ());
2516+
2517+ MI.eraseFromParent ();
2518+ break ;
2519+ }
25012520 case AMDGPU::ENTER_STRICT_WWM: {
25022521 // This only gets its own opcode so that SIPreAllocateWWMRegs can tell when
25032522 // Whole Wave Mode is entered.
@@ -9315,13 +9334,16 @@ SIInstrInfo::decomposeMachineOperandsTargetFlags(unsigned TF) const {
93159334ArrayRef<std::pair<unsigned , const char *>>
93169335SIInstrInfo::getSerializableDirectMachineOperandTargetFlags () const {
93179336 static const std::pair<unsigned , const char *> TargetFlags[] = {
9318- { MO_GOTPCREL, " amdgpu-gotprel" },
9319- { MO_GOTPCREL32_LO, " amdgpu-gotprel32-lo" },
9320- { MO_GOTPCREL32_HI, " amdgpu-gotprel32-hi" },
9321- { MO_REL32_LO, " amdgpu-rel32-lo" },
9322- { MO_REL32_HI, " amdgpu-rel32-hi" },
9323- { MO_ABS32_LO, " amdgpu-abs32-lo" },
9324- { MO_ABS32_HI, " amdgpu-abs32-hi" },
9337+ {MO_GOTPCREL, " amdgpu-gotprel" },
9338+ {MO_GOTPCREL32_LO, " amdgpu-gotprel32-lo" },
9339+ {MO_GOTPCREL32_HI, " amdgpu-gotprel32-hi" },
9340+ {MO_GOTPCREL64, " amdgpu-gotprel64" },
9341+ {MO_REL32_LO, " amdgpu-rel32-lo" },
9342+ {MO_REL32_HI, " amdgpu-rel32-hi" },
9343+ {MO_REL64, " amdgpu-rel64" },
9344+ {MO_ABS32_LO, " amdgpu-abs32-lo" },
9345+ {MO_ABS32_HI, " amdgpu-abs32-hi" },
9346+ {MO_ABS64, " amdgpu-abs64" },
93259347 };
93269348
93279349 return ArrayRef (TargetFlags);
0 commit comments