Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old processor detection code on Power #5547

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

harryyu1994
Copy link
Contributor

Signed-off-by: Harry Yu harryyu1994@gmail.com

Signed-off-by: Harry Yu <harryyu1994@gmail.com>
@harryyu1994
Copy link
Contributor Author

@fjeremic This is similar to what I had done to Z. I figured you can easily review and merge this one.

@aviansie-ben
Copy link
Contributor

@genie-omr build plinux,aix

@aviansie-ben aviansie-ben self-assigned this Sep 15, 2020
@aviansie-ben aviansie-ben merged commit 8a248d0 into eclipse-omr:master Sep 15, 2020
@harryyu1994 harryyu1994 deleted the updateCPUonP branch September 15, 2020 16:16
harryyu1994 added a commit to harryyu1994/openj9 that referenced this pull request Sep 23, 2020
Summary of changes:
- Retire old version cpu detection code on Power
- Move `CPU::getProcessorDescription()` to base J9CPU class as the 3 platforms (X, Z, Power) share the same code. There is no need to have 3 copies
- Reasons for the removal:
  - We kept the old version because we wanted to make sure new version and old version give us the same behaviour
  - Now it's been a few month and we don't see any bugs with the new version there's no reason to keep the old version
  - Also we want to prevent developers from using the old version.

Old design
- Initializes the `TR_Processor` struct via j9port library
  - Initialization occurs in `TR_J9VM::initializeProcessorType()`
  - obtain cpu information using `CPU::TO_PORTLIB_getJ9ProcessorDesc()`
  - `TR::Compiler->target.cpu.setProcessor` to set processor
- Fields and methods associated with the old design live in `Class CPU`
- Common APIs:
  - `CPU::TO_PORTLIB_getJ9ProcessorDesc()`
  - `j9sysinfo_processor_has_feature(processorDesc, feature)` (j9port library API)
  - `CPU::id()`
  - `CPU::setProcessor(TR_Processor)`

New design
- Initializes the `OMRProcessorDesc` struct via omrport library
  - `CPU::detect()` to initialize `OMRProcessorDesc processorDescription`
  - `CPU::applyUserOptions()` to apply any debug options after initialization
  - `TR::Compiler->target.cpu` singleton variable that holds the CPU instance
  - `comp()->target().cpu` per compilation variable which is used for cross-cpu compilation support
    - For JIT we initialize `comp()->target().cpu` with `TR::Compiler->target.cpu` (Host CPU)
    - For AOT we initialize `comp()->target().cpu` with `TR::Compiler->relocatableTarget.cpu` (Portable CPU)
- Fields and methods associated with the new design live in `Class CPU`
- Common APIs:
  - `CPU::supportsFeature(feature)`
  - `CPU::isAtLeast(OMRProcessorArchitecture)`
- Benefits:
  - Common to all 3 platforms
  - Simpler interface
  - Cross-CPU compilation support (Use one cpu for AOT and another for JIT)
- The implementation for the new design is first introduced here eclipse-omr/omr#5197 and eclipse-openj9#9571

issue: eclipse-omr/omr#4339
depends on: eclipse-omr/omr#5547

Signed-off-by: Harry Yu <harryyu1994@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants