[LLVMdev] LICM/store-aliasing of global loads

Dan Gohman gohman at apple.com
Thu Jul 24 17:33:57 PDT 2008


Hello Stefanus,

Your LICM patch is fine on its own, but it turns out that since
CodeGen can't always rematerialize loads of GlobalVariable constants,
it causes some performance regressions. I've disabled this feature by
default for now. You can enable it with the
-enable-licm-constant-variables option.

I didn't want to do this :-), so I made an attempt to fix CodeGen by
adding some basic remat improvements. They help out in some cases,
however it turns out that they're not sufficient in the face of
PIC-mode complications. It looks this won't be easily fixable until
after some of the major infrastructure projects are done.

Along the way, I noticed that AliasAnalsis::pointsToConstantMemory
could be used when building SelectionDAGs, which allows us to freely
schedule loads from constant global variables. The larger problem of
using alias-analysis to improve scheduling is still open, but this
change does address the specific concern you originally asked
about :-).

Dan




More information about the llvm-dev mailing list