Implement a little hack for parity with GCC on crafty. This speeds up
authorChris Lattner <sabre@nondot.org>
Mon, 12 Dec 2005 07:19:13 +0000 (07:19 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 12 Dec 2005 07:19:13 +0000 (07:19 +0000)
commita188894d67a3cc2516b25aae9b3cbdbff4b0babe
treec94965b48ef9f18d07c2b75d597b0a7657940b7a
parentfa8f80ae0a6695f78265a9faa822478b5694d48c
Implement a little hack for parity with GCC on crafty.  This speeds up
186.crafty by about 16% (from 15.109s to 13.045s) on my system.

This turns allocas with unions/casts into scalars.  For example crafty has
something like this:

    union doub {
      unsigned short i[4];
      long long d;
    };
int f(long long a) {
  return ((union doub){.d=a}).i[1];
}

Instead of generating loads and stores to an alloca, we now promote the
whole thing to a scalar long value.

This implements: Transforms/ScalarRepl/AggregatePromote.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24667 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/ScalarReplAggregates.cpp