Instructions for Book E PPC should be word aligned, set function alignment to reflect this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142194 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index d6b8a9e..dcc0568 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -402,9 +402,16 @@
setLibcallName(RTLIB::EXP2_PPCF128, "exp2l$LDBL128");
}
- setMinFunctionAlignment(2);
- if (PPCSubTarget.isDarwin())
- setPrefFunctionAlignment(4);
+ if (PPCSubTarget.isBookE()) {
+ // Book E: Instructions are always four bytes long and word-aligned.
+ setMinFunctionAlignment(4);
+ setPrefFunctionAlignment(8);
+ }
+ else {
+ setMinFunctionAlignment(2);
+ if (PPCSubTarget.isDarwin())
+ setPrefFunctionAlignment(4);
+ }
setInsertFencesForAtomic(true);