SPO600 2025 Winter Project - Stage 3: Plan (Part1)

 As part of the final stage of the SPO600 project, I will be extending and polishing my custom GCC pass (skim) to support analyzing multiple clone groups and provide accurate [PRUNE] and [NO PRUNE] recommendations. Below is a structured plan for how I intend to proceed with Stage III, in line with the official requirements and challenges outlined by professor.


Objectives

  1. Support multiple clone groups

    • Remove the assumption that only one base+clone pair exists.

    • Detect and compare multiple function clone groups independently.

  2. Build realistic test cases

    • Write at least two FMV-cloned functions per test case (e.g. scale_samples, sum_data).

    • Design one function to produce a [PRUNE] and another to produce a [NO PRUNE] result.

  3. Ensure cross-architecture compatibility

    • Validate pass functionality on both x86_64 and aarch64.

    • Confirm that PRUNE/NOPRUNE logic works across target-specific clones.

  4. Improve diagnostics

    • Add BB count and statement count diff messages to aid debugging.

    • Log detailed clone comparisons per function group.

  5. Finalize cleanup and usability

    • Keep my implementation style, avoiding major structure rewrites.

    • Fix any logic gaps that led to silent failures in Stage II.



Test Plan

  • Create a test with two functions:

    1. A simple sum_data() to encourage pruning.

    2. A complex scale_samples() to avoid pruning.

  • Use __attribute__((target_clones(...))) to generate FMV variants.

  • Compile with custom-built GCC and inspect .skim dumps for correct classification.



Goal

By the end of Stage III, my pass should be able to:

  • Analyze multiple clone groups.

  • Output detailed logs in .skim files.

  • Provide both [PRUNE] and [NO PRUNE] results within the same compilation.

  • Be usable by others through shared Makefile and test sources.

This wraps up the technical plan. Implementation and testing will follow in the next blog update.






Comments

Popular posts from this blog

SPO600 2025 Winter Project - Stage 1: Create a Basic GCC Pass (part1)

SPO600 2025 Winter Project - Stage 2: GIMPLE Level Clone Analysis and Pruning (part4)

Lab 1 - 6502 Assembly Language