Skip to content

Commit

Permalink
Remove FOREACH_REGISTER_FILE macro (#57613)
Browse files Browse the repository at this point in the history
  • Loading branch information
echesakov authored Aug 20, 2021
1 parent 256e0ef commit 183c7d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
#include "regset.h"
#include "jitgcinfo.h"

#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_ARM)
#define FOREACH_REGISTER_FILE(file) \
for ((file) = &(this->intRegState); (file) != NULL; \
(file) = ((file) == &(this->intRegState)) ? &(this->floatRegState) : NULL)
#else
#define FOREACH_REGISTER_FILE(file) (file) = &(this->intRegState);
#endif

class CodeGen final : public CodeGenInterface
{
friend class emitter;
Expand Down
14 changes: 9 additions & 5 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7562,8 +7562,6 @@ void CodeGen::genFnProlog()
* Take care of register arguments first
*/

RegState* regState;

// Update the arg initial register locations.
compiler->lvaUpdateArgsWithInitialReg();

Expand All @@ -7572,8 +7570,7 @@ void CodeGen::genFnProlog()
//
if (!compiler->opts.IsOSR())
{
FOREACH_REGISTER_FILE(regState)
{
auto assignIncomingRegisterArgs = [this, initReg, &initRegZeroed](RegState* regState) {
if (regState->rsCalleeRegArgMaskLiveIn)
{
// If we need an extra register to shuffle around the incoming registers
Expand All @@ -7600,7 +7597,14 @@ void CodeGen::genFnProlog()
initRegZeroed = false;
}
}
}
};

#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_ARM)
assignIncomingRegisterArgs(&intRegState);
assignIncomingRegisterArgs(&floatRegState);
#else
assignIncomingRegisterArgs(&intRegState);
#endif
}

// Home the incoming arguments.
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/cpp.hint
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// See the article on hints in MSDN for more information on their necessity and use:
// http://msdn.microsoft.com/en-us/library/dd997977.aspx

#define FOREACH_REGISTER_FILE(file) for (;;)

// From jit.h

#define INDEBUG(x) x
Expand Down

0 comments on commit 183c7d0

Please sign in to comment.