Index: include/llvm/Target/TargetMachine.h =================================================================== --- include/llvm/Target/TargetMachine.h +++ include/llvm/Target/TargetMachine.h @@ -259,6 +259,10 @@ /// PEI. If false (virtual-register machines), then callee-save register /// spilling and scavenging are not needed or used. virtual bool usesPhysRegsForPEI() const { return true; } + + virtual bool useIPRA() const { + return false; + } }; /// This class describes a target machine that is implemented with the LLVM Index: lib/Target/TargetMachine.cpp =================================================================== --- lib/Target/TargetMachine.cpp +++ lib/Target/TargetMachine.cpp @@ -47,6 +47,10 @@ RequireStructuredCFG(false), DefaultOptions(Options), Options(Options) { if (EnableIPRA.getNumOccurrences()) this->Options.EnableIPRA = EnableIPRA; + else { + // If not explicitly specified, use target default. + this->Options.EnableIPRA = useIPRA(); + } } TargetMachine::~TargetMachine() {