Enable the shrink wrapping optimization for PPC64.
authorKit Barton <kbarton@ca.ibm.com>
Thu, 10 Sep 2015 01:55:44 +0000 (01:55 +0000)
committerKit Barton <kbarton@ca.ibm.com>
Thu, 10 Sep 2015 01:55:44 +0000 (01:55 +0000)
commit37d7ddff3efc44da34a33e08b8f2f94e16505ef3
tree0b752a10d5f6fbeefab406dab9197e1ed63f6432
parentb01975128c71aeafc3e74c866342d4b60ee0725e
Enable the shrink wrapping optimization for PPC64.

The changes in this patch are as follows:
  1. Modify the emitPrologue and emitEpilogue methods to work properly when the prologue and epilogue blocks are not the first/last blocks in the function
  2. Fix a bug in PPCEarlyReturn optimization caused by an empty entry block in the function
  3. Override the runShrinkWrap PredicateFtor (defined in TargetMachine) to check whether shrink wrapping should run:
      Shrink wrapping will run on PPC64 (Little Endian and Big Endian) unless -enable-shrink-wrap=false is specified on command line

A new test case, ppc-shrink-wrapping.ll was created based on the existing shrink wrapping tests for x86, arm, and arm64.

Phabricator review: http://reviews.llvm.org/D11817

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247237 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCEarlyReturn.cpp
lib/Target/PowerPC/PPCFrameLowering.cpp
lib/Target/PowerPC/PPCFrameLowering.h
test/CodeGen/PowerPC/ppc-shrink-wrapping.ll [new file with mode: 0644]