PROJECT STAGE 1

Getting started: 

-Obtain the source code for the current development version of GCC from the Git repository.

git clone git://gcc.gnu.org/git/gcc.git

 cd gcc 

-To build GCC outside of the source tree to keep things clean, build directory was created by following command:

mkdir build

Configure the build for each of two environments. It sets up the build to create a compiler.


-Build GCC.

Run make to start the compilation process.


Task 1 

Prune Cloned Functions

(a) Specific, Relevant Sections of the GCC Code Base

The relevant sections of the GCC codebase to prune cloned functions can be found in the files where function versioning and cloning are handled. This includes:

gcc/function.c for managing functions.

gcc/config/aarch64/aarch64.c for configuring AArch64.

gcc/tree-vect-loop.c, or similar files, for vectorization and cloning logic.


(b) Work Detail

It is involved in the identification of cloned functions in AFMV, which do not offer enough improvements in performance or functionality. This includes:

- Logic for comparing the performance or code size of cloned functions against their original versions.

- Creation of criteria or heuristics to decide whether a cloned function is worth keeping.

- Implementing the necessary changes in the codebase of GCC by suppressing or erasing cloned functions that do not meet these criteria.


(c) Tools and Techniques

- Debuggers (gdb), profilers, and GCC itself for testing.

- Performance benchmarking, code analysis, and possibly machine learning in developing heuristics.


(d)  Test the Work

Create benchmarks that measure the performance impact of cloned functions.

Use existing GCC test suites to ensure that pruning does not affect the correctness of compiled programs.

Compare the size and execution speed of binaries compiled with and without pruning.


(e) Skills and Knowledge Acquisition

Deep understanding of the inner workings of GCC's architecture and its function cloning mechanisms.

Knowledge of the AArch64 architecture and how to manipulate the various features for affecting performance.

Proficiency in analyzing performance and benchmarking.


(f) Completing Tasks Independently

Design the pruning logic in an organized manner to be tested independently of the AFMV feature.

Make use of mock functions and data to replicate different scenarios for initial testing.


(g) Interface wit Other Tasks

Ensure the pruning logic can access the required information on cloned functions and their related performance metrics.

Make sure developers working on the AFMV feature can integrate pruning smoothly.


(h) Rough Estimate of the Amount of Work Involved

Estimate: Approximately 60-80 hours.

Rationale: It includes time to understand the necessary GCC internals, developing and testing the pruning logic, and then integrating it with the AFMV feature. The complexity of GCC and thorough testing contribute to this estimate.


Task 2

arch= Arguments

(a) Specified, Relevant Sections of the GCC Code Base

Source Files: Look into gcc/config/aarch64/aarch64.c for AArch64-specific configurations and into gcc/config/aarch64/aarch64.opt for option definitions. Also, to look into the general command-line options handling, gcc/common.opt.

Documentation: The GCC Internals documentation and the AArch64 porting guide will be vital in understanding how arguments are processed for architecture-specific cases.

(b) Description of Work

Modify the AArch64 backend to parse and identify "arch=" arguments, similarly to the x86 backend.

Write the logic mapping "arch=" arguments to the corresponding sets of feature flags that define each architecture version.

Implement functions which enable or disable specific function versions of the architecture defined in "arch=" accordingly.

(c) Tools and Techniques

Tools: Use text editors or IDEs for code modifications, grep for searching the GCC codebase, and Git for version control.

Techniques: Command-line argument parsing, conditional compilation based on architecture features, and most probably, a mapping structure for "arch=" arguments to feature flags.

(d)Test the Work

Develop test cases that compile code using various "arch=" arguments and verify that the right feature flags are enabled.

Use the built-in GCC testing framework, probably DejaGnu, to ingrate these tests and ensure that they pass across all relevant scenarios.

(e) Skills and Knowledge Acquisition

Ability to understand the specific architecture differences between various AArch64 versions and their translation into feature flags. Familiarity with AArch64 variants.

Good command over the language of C programming, especially working with GCC's codebase.

(f) Completing Tasks Independently

Focuses on making the parsing of "arch=" arguments more modular so that it can be made independently of other parts of the FMV implementation.

Use stubs or mocks for feature flags during initial development to test the parsing and mapping logic in isolation.

(g) Interface with Other Tasks

Verify that the parsed "arch=" arguments are correctly enabling or disabling the FMV feature by applying logic to the "arch=" argument.

Keep the developers of FMV cloning and pruning in touch with your work, so that the architectural versions are correctly accepted.

(h) Rough Estimate of the Amount of Work Involved

Estimate: Around 40-60 hours.

Rationale: This includes time spent understanding the relevant parts of the GCC codebase, the implementation of "arch=" argument parsing and mapping, making tests, and integration with the existing FMV feature. The difficulty of the GCC codebase and thorough testing have contributed significantly to this estimate.

Priority:

For a student aspiring to be a developer, enhancing the GCC AArch64 FMV capability by adding "arch=" arguments presents an enriching opportunity. This task dives deep into the intricacies of compiler technology, offering hands-on experience with one of the most sophisticated open-source projects. It's a chance to contribute meaningfully to the global developer community, ensuring software can leverage the latest hardware architectures efficiently. Beyond the technical skills gained in understanding compiler design and command-line parsing, this project fosters cross-disciplinary learning, from software architecture to the nuances of computer hardware. Engaging with the GCC community also hones collaboration and communication skills, essential for any aspiring developer. This experience not only elevates a student's technical prowess but also significantly boosts their career prospects, showcasing their capability to tackle complex, impactful projects. It's a unique blend of learning, contributing, and advancing in the world of software development.


Comments

Popular posts from this blog

Assembly language code lab 2

PROJECT STAGE 2 - DejaGNU Testing Framework