aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff options
context:
space:
mode:
authorKit Barton <kbarton@ca.ibm.com>2015-12-07 20:50:29 +0000
committerKit Barton <kbarton@ca.ibm.com>2015-12-07 20:50:29 +0000
commita1c712fae5bc6f2b65562a0c3d79f6dd4570c2bc (patch)
tree4405687da4e061d308f5c18f2143d3e9889c0ada /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
parent1ffd4f509324e70d529f7cb1141adbd25ae0ea83 (diff)
downloadllvm-a1c712fae5bc6f2b65562a0c3d79f6dd4570c2bc.zip
llvm-a1c712fae5bc6f2b65562a0c3d79f6dd4570c2bc.tar.gz
llvm-a1c712fae5bc6f2b65562a0c3d79f6dd4570c2bc.tar.bz2
[PPC64] Convert bool literals to i32
Convert i1 values to i32 values if they should be allocated in GPRs instead of CRs. Phabricator: http://reviews.llvm.org/D14064 llvm-svn: 254942
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetMachine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index 24a9ef0..946e0f1 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -71,6 +71,9 @@ extern "C" void LLVMInitializePowerPCTarget() {
RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target);
RegisterTargetMachine<PPC64TargetMachine> B(ThePPC64Target);
RegisterTargetMachine<PPC64TargetMachine> C(ThePPC64LETarget);
+
+ PassRegistry &PR = *PassRegistry::getPassRegistry();
+ initializePPCBoolRetToIntPass(PR);
}
/// Return the datalayout string of a subtarget.
@@ -286,6 +289,8 @@ TargetPassConfig *PPCTargetMachine::createPassConfig(PassManagerBase &PM) {
}
void PPCPassConfig::addIRPasses() {
+ if (TM->getOptLevel() != CodeGenOpt::None)
+ addPass(createPPCBoolRetToIntPass());
addPass(createAtomicExpandPass(&getPPCTargetMachine()));
// For the BG/Q (or if explicitly requested), add explicit data prefetch