Skip to content

Commit 5fe510e

Browse files
committed
Add check
1 parent c8ce2df commit 5fe510e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/AArch64/SMEPeepholeOpt.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ bool SMEPeepholeOpt::optimizeStartStopPairs(
189189
case AArch64::CommitZASavePseudo:
190190
case AArch64::SMEStateAllocPseudo:
191191
case AArch64::RequiresZASavePseudo:
192+
// These instructions only depend on the ZA state, not the streaming mode,
193+
// so if the pair of smstart/stop is only changing the streaming mode, we
194+
// can permit these instructions.
195+
if (Prev->getOperand(0).getImm() != AArch64SVCR::SVCRSM)
196+
Prev = nullptr;
197+
break;
192198
case AArch64::ADJCALLSTACKDOWN:
193199
case AArch64::ADJCALLSTACKUP:
194200
case AArch64::ANDXri:

0 commit comments

Comments
 (0)