@@ -167,24 +167,24 @@ class CompilerBase<Adaptor, Derived, Config>::ValuePart {
167167
168168private:
169169 template <bool Reload>
170- void alloc_reg_impl (CompilerBase *compiler, u64 exclusion_mask ) noexcept ;
170+ void alloc_reg_impl (CompilerBase *compiler) noexcept ;
171171 AsmReg alloc_specific_impl (CompilerBase *compiler,
172172 AsmReg reg,
173173 bool reload) noexcept ;
174174
175175public:
176176 // / Allocate and lock a register for the value part, *without* reloading the
177177 // / value. Asserts that no register is currently allocated.
178- AsmReg alloc_reg (CompilerBase *compiler, u64 exclusion_mask = 0 ) noexcept {
179- alloc_reg_impl</* Reload=*/ false >(compiler, exclusion_mask );
178+ AsmReg alloc_reg (CompilerBase *compiler) noexcept {
179+ alloc_reg_impl</* Reload=*/ false >(compiler);
180180 return cur_reg ();
181181 }
182182
183183 // / Allocate and lock a register for the value part, *without* reloading the
184184 // / value. Does nothing if a register is already allocated.
185185 AsmReg cur_reg_or_alloc (CompilerBase *compiler) noexcept {
186186 if (!has_reg ()) {
187- alloc_reg_impl</* Reload=*/ false >(compiler, 0 );
187+ alloc_reg_impl</* Reload=*/ false >(compiler);
188188 }
189189 return cur_reg ();
190190 }
@@ -232,7 +232,7 @@ class CompilerBase<Adaptor, Derived, Config>::ValuePart {
232232 // / the stack or materializing the constant if necessary. Requires that the
233233 // / value is currently unlocked (i.e., has_reg() is false).
234234 AsmReg load_to_reg (CompilerBase *compiler) noexcept {
235- alloc_reg_impl</* Reload=*/ true >(compiler, 0 );
235+ alloc_reg_impl</* Reload=*/ true >(compiler);
236236 return cur_reg ();
237237 }
238238
@@ -402,7 +402,7 @@ class CompilerBase<Adaptor, Derived, Config>::ValuePart {
402402template <IRAdaptor Adaptor, typename Derived, CompilerConfig Config>
403403template <bool Reload>
404404void CompilerBase<Adaptor, Derived, Config>::ValuePart::alloc_reg_impl(
405- CompilerBase *compiler, u64 exclusion_mask ) noexcept {
405+ CompilerBase *compiler) noexcept {
406406 // The caller has no control over the selected register, so it must assume
407407 // that this function evicts some register. This is not permitted if the value
408408 // state ought to be the same.
@@ -414,9 +414,6 @@ void CompilerBase<Adaptor, Derived, Config>::ValuePart::alloc_reg_impl(
414414 auto ap = assignment ();
415415 if (ap.register_valid ()) {
416416 lock (compiler);
417- // TODO: implement this if needed
418- assert ((exclusion_mask & (1ull << state.v .reg .id ())) == 0 &&
419- " moving registers in alloc_reg is unsupported" );
420417 return ;
421418 }
422419
@@ -425,7 +422,7 @@ void CompilerBase<Adaptor, Derived, Config>::ValuePart::alloc_reg_impl(
425422 bank = state.c .bank ;
426423 }
427424
428- Reg reg = compiler->select_reg (bank, exclusion_mask );
425+ Reg reg = compiler->select_reg (bank);
429426 auto ®_file = compiler->register_file ;
430427 reg_file.mark_clobbered (reg);
431428 if (has_assignment ()) {
@@ -870,9 +867,7 @@ struct CompilerBase<Adaptor, Derived, Config>::ValuePartRef : ValuePart {
870867 return *this ;
871868 }
872869
873- AsmReg alloc_reg (u64 exclusion_mask = 0 ) noexcept {
874- return ValuePart::alloc_reg (compiler, exclusion_mask);
875- }
870+ AsmReg alloc_reg () noexcept { return ValuePart::alloc_reg (compiler); }
876871
877872 AsmReg cur_reg_or_alloc () noexcept {
878873 return ValuePart::cur_reg_or_alloc (compiler);
0 commit comments