[llvm] [AMDGPU] RA inserted scalar instructions can be at the BB top (PR #72140)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 13:54:34 PST 2023


================
@@ -8474,16 +8474,24 @@ unsigned SIInstrInfo::getLiveRangeSplitOpcode(Register SrcReg,
   return AMDGPU::COPY;
 }
 
-bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI) const {
+bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI,
+                                       Register Reg) const {
   // We need to handle instructions which may be inserted during register
   // allocation to handle the prolog. The initial prolog instruction may have
   // been separated from the start of the block by spills and copies inserted
-  // needed by the prolog.
+  // needed by the prolog. However, the insertions for scalar registers can
+  // always be placed at the BB top as they are independent of the exec mask
+  // value.
   uint16_t Opc = MI.getOpcode();
----------------
rampitec wrote:

Still the whole block can be avoided if Reg is unset.

https://github.com/llvm/llvm-project/pull/72140


More information about the llvm-commits mailing list