From 98daa9dcc8cf5bf87f06a085793c543c035313d9 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 17 Oct 2011 17:01:41 +0000 Subject: [PATCH] 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 --- lib/Target/PowerPC/PPCISelLowering.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index d6b8a9ee93c..dcc05683682 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -402,9 +402,16 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) 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); -- 2.34.1