From d89125a5d8827b3f427a14ad5fe7e190b7cee3cd Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 22 Nov 2013 19:11:24 +0000 Subject: Teach ISel not to optimize 'optnone' functions (revised). Improvements over r195317: - Set/restore EnableFastISel flag instead of just running FastISel within SelectAllBasicBlocks; the flag is checked in various places, and FastISel won't run properly if those places don't do the right thing. - Test looks for normal ISel versus FastISel behavior, and not something more subtle that doesn't work everywhere. Based on work by Andrea Di Biagio. llvm-svn: 195491 --- llvm/lib/Target/TargetMachine.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target/TargetMachine.cpp') diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index b367287b530..9ba78bce7f9 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -164,6 +164,11 @@ CodeGenOpt::Level TargetMachine::getOptLevel() const { return CodeGenInfo->getOptLevel(); } +void TargetMachine::setOptLevel(CodeGenOpt::Level Level) const { + if (CodeGenInfo) + CodeGenInfo->setOptLevel(Level); +} + bool TargetMachine::getAsmVerbosityDefault() { return AsmVerbosityDefault; } -- cgit v1.2.3