[llvm] [Hexagon] Prevent optimizing out counter reads (PR #182338)

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 11:21:50 PST 2026


================
@@ -349,6 +349,16 @@ def LDriw_ctr : LDInst<(outs CtrRegs:$dst),
                         (ins IntRegs:$addr, s32_0Imm:$off),
                         ".error \"should not emit\"", []>;
 
+let isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 1 in {
+  def PS_TfrCRR : InstHexagon<(outs IntRegs:$Rd32), (ins CtrRegs:$Cs32),
----------------
kparzysz wrote:

Those are some really ugly names.  Why not something like PS_readcr/PS_readcr64?

Otherwise LGTM.

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


More information about the llvm-commits mailing list