[llvm-commits] [dragonegg] r126086 - /dragonegg/trunk/llvm-backend.cpp
Duncan Sands
baldrick at free.fr
Sun Feb 20 09:26:16 PST 2011
Author: baldrick
Date: Sun Feb 20 11:26:16 2011
New Revision: 126086
URL: http://llvm.org/viewvc/llvm-project?rev=126086&view=rev
Log:
Setup the new TargetLibraryInfo pass.
Modified:
dragonegg/trunk/llvm-backend.cpp
Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=126086&r1=126085&r2=126086&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Sun Feb 20 11:26:16 2011
@@ -43,6 +43,7 @@
#include "llvm/Support/StandardPasses.h"
#include "llvm/Target/SubtargetFeature.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Target/TargetRegistry.h"
// System headers
@@ -689,6 +690,13 @@
if (optimize > 0 && !DisableLLVMOptimizations) {
HasPerFunctionPasses = true;
+
+ TargetLibraryInfo *TLI =
+ new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
+ if (flag_no_simplify_libcalls)
+ TLI->disableAllFunctions();
+ PerFunctionPasses->add(TLI);
+
PerFunctionPasses->add(createCFGSimplificationPass());
if (optimize == 1)
PerFunctionPasses->add(createPromoteMemoryToRegisterPass());
@@ -754,6 +762,12 @@
bool HasPerModulePasses = false;
if (!DisableLLVMOptimizations) {
+ TargetLibraryInfo *TLI =
+ new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
+ if (flag_no_simplify_libcalls)
+ TLI->disableAllFunctions();
+ PerModulePasses->add(TLI);
+
bool NeedAlwaysInliner = false;
llvm::Pass *InliningPass = 0;
if (flag_inline_small_functions && !flag_no_inline) {
More information about the llvm-commits
mailing list