[llvm] [AArch64][SME] Use entry pstate.sm for conditional streaming-mode chnges (PR #152169)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 09:20:11 PDT 2025


================
@@ -1178,7 +1178,9 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
   if (Node->getValueType(Node->getNumValues()-1) == MVT::Glue) {
     for (SDNode *F = Node->getGluedUser(); F; F = F->getGluedUser()) {
       if (F->getOpcode() == ISD::CopyFromReg) {
-        UsedRegs.push_back(cast<RegisterSDNode>(F->getOperand(1))->getReg());
+        Register Reg = cast<RegisterSDNode>(F->getOperand(1))->getReg();
+        if (Reg.isPhysical())
+          UsedRegs.push_back(Reg);
----------------
MacDue wrote:

This was adding bogus implict-defs of virtual registers used in the `CopyFromReg` glued to the `SMSTART/STOP`. From the comment above, I believe this is a bug, and this should only collect physregs. 

Comment: 
https://github.com/llvm/llvm-project/blob/dd0bb2c3a8675ff1e2b9de565a301c0a09d3063b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp#L1148-L1162

(I think this code corresponds the case 2)

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


More information about the llvm-commits mailing list