[llvm] AMDGPU/GlobalISel: RegBankLegalize rules for returnaddress (PR #191318)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 09:25:19 PDT 2026


================
@@ -1470,6 +1470,8 @@ RegBankLegalizeRules::RegBankLegalizeRules(const GCNSubtarget &_ST,
 
   using namespace Intrinsic;
 
+  addRulesForIOpcs({returnaddress}, StandardB).Uni(B64, {{SgprB64}, {}});
----------------
vangthao95 wrote:

>From what I understand, None, IntrId, Imm, are all placeholders and interchangeable and are used to indicate that these operands does not need to be looked at. ".Uni" and ".Div" indicates these are fast rules and can be selected in O(1) time while ".Any" rules are the slower rules. We have fast rule entries for Standard (S16, S32, S64, V2S16) and StandardB (B32, B64, B96, B128). .Any(Uni64) is the equivalent of .Uni(S64) so we could use fast rules for amdgcn_s_getpc.

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


More information about the llvm-commits mailing list