From f26455afc887e0911a06df550530db6c2443e789 Mon Sep 17 00:00:00 2001 From: Yang Rong Date: Thu, 28 Nov 2013 11:00:43 +0800 Subject: [PATCH] Use -O1 when -cl-opt-disable, for inline function. Signed-off-by: Yang Rong Reviewed-by: Zhigang Gong --- backend/src/backend/program.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index 8e80bbb..068ca0d 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -498,11 +498,15 @@ namespace gbe { args.push_back("-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND"); #endif args.push_back("-emit-llvm"); - // XXX we haven't implement those builtin functions, + // FIXME we haven't implement those builtin functions, // so disable it currently. args.push_back("-fno-builtin"); + // FIXME as we don't support function call currently, we may encounter + // build problem with -O0 as we rely on always inline all functions option. if(bOpt) args.push_back("-O2"); + else + args.push_back("-O1"); if(bFastMath) args.push_back("-D __FAST_RELAXED_MATH__=1"); #if LLVM_VERSION_MINOR <= 2 -- 2.7.4