================
@@ -1326,6 +1326,79 @@ bool RegisterCoalescer::reMaterializeDef(const 
CoalescerPair &CP,
   if (!TII->isAsCheapAsAMove(*DefMI))
     return false;
 
+  // Skip rematerialization for physical registers used as return values within
+  // the same basic block to enable better coalescing.
+  if (DstReg.isPhysical()) {
----------------
antoniofrighetto wrote:

Could you please move this into a dedicated helper, e.g., 
`shouldSkipRematerializationForReturn` and add a brief doc-comment?

https://github.com/llvm/llvm-project/pull/163047
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to