This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Enable fast-isel on AIX 64 subtarget
ClosedPublic

Authored by qiucf on Mar 18 2021, 12:34 AM.

Details

Summary

This patch basically enables fast-isel for AIX 64-bit subtarget (previously enabled only for ELF 64). The initial motivation is to introduce branch folding to AIX generated code for correct debug behavior. I also saw some compiling time improvement in a few LLVM test-suite benchmarks. (toast, dbms, cjpeg, burg, etc.)

Diff Detail

Event Timeline

qiucf created this revision.Mar 18 2021, 12:34 AM
qiucf requested review of this revision.Mar 18 2021, 12:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2021, 12:34 AM

This patch is missing context as well as a description. Can you please add both? It would be good to understand why we want FISEL on AIX. Perhaps some compile-time measurement on some significantly sized code. Also, some notes about how well this was tested would be useful. A different instruction selector is a significant change so it would be good to do some thorough testing at -O0 including some binary compatibility testing (with GCC and/or the system compiler).

qiucf added a comment.Apr 11 2021, 7:08 PM

This patch is missing context as well as a description. Can you please add both? It would be good to understand why we want FISEL on AIX. Perhaps some compile-time measurement on some significantly sized code. Also, some notes about how well this was tested would be useful. A different instruction selector is a significant change so it would be good to do some thorough testing at -O0 including some binary compatibility testing (with GCC and/or the system compiler).

The motivating case is that unconditional branches are not folded for AIX O0 code. Like code below:

void foo();

int x = 1000;
int main() {
  for (int i = 0; i < x; i++)
    foo();
  return 0;
}

DAG ISel counts on later optimization passes to do the folding while FastISel does it in branch selection. This is needed for correct debug behavior on AIX.

As for compiling time, I saw improvement on some benchmarks in test-suite. For 64-bit AIX target, this patch (actually, a smaller one) can pass SPEC benchmarks and LLVM test-suite, more work is needed for enabling it on 32-bit.

qiucf edited the summary of this revision. (Show Details)Apr 11 2021, 7:12 PM
qiucf updated this revision to Diff 336741.Apr 11 2021, 10:07 PM
qiucf retitled this revision from [PowerPC] Enable fast-isel on AIX subtarget to [PowerPC] Enable fast-isel on AIX 64 subtarget.

Only include changes to AIX64.

jsji accepted this revision as: jsji.EditedAug 31 2021, 11:38 AM

LGTM. Make sure you run all the tests we have on AIX before committing. Thanks.

llvm/lib/Target/PowerPC/PPCFastISel.cpp
2473

Can we just check isPPC64() now? Do we have 64 target other than ELF + AIX?

This revision is now accepted and ready to land.Aug 31 2021, 11:38 AM
This revision was automatically updated to reflect the committed changes.