flang
flang copied to clipboard
Machreg refactor
Currently used machreg is too much x86_64 specific. Proposed change makes it easier to provide architecture-specific tuning and as an example it introduces some tuning for AArch64.
ping @SouraVX @shivaramaarao
@pawosm-arm AMD engineers need some documentation to proceed.
Hi @kiranchandramohan, This was purely conceptual work with no documentation ever written. This PR consists of three commits:
machreg: AArch64 has 64-bit registers, no need to pack, this commit removes unnecessary operation that remained in flang from the times where it didn't distinguish between 32- and 64-bit ARM architectures. This is one of the last places like that still remaining in flang's codebasemachreg: in order to ease further arch specific improvements, remove unused functions. Before I started to make this machreg code more architecturarly-neutral I've found some pieces of code that were never used; this commit removes these pieces of code just to make it easier to work with.machreg: architecture specific initializations. This is the main thing. Things normally defined intools/flang2/flang2exe/machreg.cppfile were moved to correspondingmachreg.hheaders (as preprocessor definitions) for individual architectures to make it easier to work on specific architectural tweaks. Having those changes applied I could do my experiments inaarch64-Linux/machreg.hfile. Not seeing much of the performance impact, I gave up eventually, nevertheless, I decided to make this refactor public so anyone else could make more creative use of it.
Is the information provided by @pawosm-arm sufficient for @shivaramaarao and @SouraVX ?