[llvm] [AMDGPU] Save/Restore SCC bit across waterfall loop. (PR #68363)

Sirish Pande via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 09:27:03 PDT 2023


================
@@ -5094,6 +5094,39 @@ unsigned SIInstrInfo::getVALUOp(const MachineInstr &MI) const {
       "Unexpected scalar opcode without corresponding vector one!");
 }
 
+bool SIInstrInfo::isSCCDefinedBefore(MachineBasicBlock &MBB,
----------------
srpande wrote:

I looked at computeRegisterLiveness code, and I am not sure if that satisfies what I want to do. 
An inst may set SCC to be live but the result of which may never be used. In that case, I don't want to save/restore. 
computeRegisterLivess always goes backwards first and checks for "defs", and if it finds defs, it says it's live. That is correct. That is necessary but not sufficient reason to generate save/restore of SCC.

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


More information about the llvm-commits mailing list