Skip to content

Updated code after 2025 Feb 24th code review#129

Open
jestrang wants to merge 4 commits intoaayasin:masterfrom
jestrang:move-elim
Open

Updated code after 2025 Feb 24th code review#129
jestrang wants to merge 4 commits intoaayasin:masterfrom
jestrang:move-elim

Conversation

@jestrang
Copy link
Copy Markdown
Contributor

Highlights:

  1. added movx/z check to get rid of reg width checks
  2. removed xyzmm lists
  3. lowercased stat name

Copy link
Copy Markdown
Collaborator

@amiri-khalil amiri-khalil Mar 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these additional kernel files should not be here, please remove them.

Insts_MRN = ['%s non-MRNable'%x for x in ['INC','DEC','LD-ST']]
Insts_V2II2V = ['%s transition-Penalty'%x for x in ['V2I','I2V']]
Insts_all = ['cond_%s'%x for x in Insts_cond] + Insts_Fusions + Insts_MRN + Insts_V2II2V + Insts_global
Insts_MovElim = ['%s move-elimination'%x for x in ['r32','r64','xmm','ymm','zmm']]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R23, R64, XMM, YMM, ZMM is better (capitals).

elif v2ii2v_dst: inc_stat('V2I transition-Penalty')
if x86.is_type(x86.MOV,line) and not info.is_memory() and not info.is_imm() and not re.match(info.inst(),x86.MOVS_ZX):
me_src=info.srcs()[0]
me_dst=info.dst()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the me_dst.

elif 'ymm' in me_src:
inc_stat('ymm move-elimination')
elif 'zmm' in me_src:
inc_stat('zmm move-elimination')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-write this block without duplicating the 'move elimination' string, maybe one long line (removing all the code inside this part, try it):
inc_stat(f'{"R64" if me_src in x86.REGS_64 else "R23" if me_src in x86.REGS_32 else "XMM" if "xmm" in me_src else "YMM" if "ymm" in me_src else "ZMM"} move elimination')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants