popcorn-compiler icon indicating copy to clipboard operation
popcorn-compiler copied to clipboard

Stack transform timing utility architecture mismatch

Open acarno opened this issue 6 years ago • 2 comments

At line 293 in lib/stack_transformation/utils/stack_transform_timing.h:

#define TIME_REWRITE( aarch64_bin, x86_64_bin ) \
  ({ \
    int ret; \
    struct timespec start = { .tv_sec = 0, .tv_nsec = 0 }; \
    struct timespec init = { .tv_sec = 0, .tv_nsec = 0 }; \
    struct timespec rewrite = { .tv_sec = 0, .tv_nsec = 0 }; \
    struct timespec end = { .tv_sec = 0, .tv_nsec = 0 }; \
    struct regset_x86_64 regset; \
    struct regset_powerpc64 regset_dest; \
    stack_bounds bounds = get_stack_bounds(); \
    READ_REGS_X86_64(regset); \
    regset.rip = get_call_site(); \
    clock_gettime(CLOCK_MONOTONIC, &start); \
    st_handle src = st_init(x86_64_bin); \
    st_handle dest = st_init(powerpc64_bin); \
    ...

From the arguments, this macro wants to compare the stack rewriting time for AArch64 and x86-64 binaries; internally, however, the macro uses regset_powerpc64 and powerpc64_bin.

acarno avatar Oct 24 '18 20:10 acarno

This looks like a copy-and-paste error -- I think aarch64_bin should simply be powerpc64_bin. Can you submit a pull request with the fix?

rlyerly avatar Nov 14 '18 01:11 rlyerly

I'll try to do so as soon as I can -- currently a bit tied up with coursework and prep for my M.S. defense. May be sometime next month before I can get to it -- sorry!!

acarno avatar Nov 14 '18 02:11 acarno