diff options
author | Tyler Nowicki <tyler.nowicki@gmail.com> | 2015-08-10 19:51:46 +0000 |
---|---|---|
committer | Tyler Nowicki <tyler.nowicki@gmail.com> | 2015-08-10 19:51:46 +0000 |
commit | c1a86f586617f8127eaf5024d27238a92a735db1 (patch) | |
tree | da915860da5199e699a372a22cefd4a4bd1b476a /llvm/lib/IR | |
parent | c2e3ba48e315312560a2fb26cbb8e8045ab9991e (diff) | |
download | bcm5719-llvm-c1a86f586617f8127eaf5024d27238a92a735db1.tar.gz bcm5719-llvm-c1a86f586617f8127eaf5024d27238a92a735db1.zip |
Late evaluation of the fast-math vectorization requirement.
This patch moves the verification of fast-math to just before vectorization is done. This way we can tell clang to append the command line options would that allow floating-point commutativity. Specifically those are enableing fast-math or specifying a loop hint.
llvm-svn: 244489
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/DiagnosticInfo.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContext.cpp | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp index 6612681d689..07c6714e913 100644 --- a/llvm/lib/IR/DiagnosticInfo.cpp +++ b/llvm/lib/IR/DiagnosticInfo.cpp @@ -196,6 +196,15 @@ void llvm::emitOptimizationRemarkAnalysis(LLVMContext &Ctx, DiagnosticInfoOptimizationRemarkAnalysis(PassName, Fn, DLoc, Msg)); } +void llvm::emitOptimizationRemarkAnalysisFPCommute(LLVMContext &Ctx, + const char *PassName, + const Function &Fn, + const DebugLoc &DLoc, + const Twine &Msg) { + Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysisFPCommute(PassName, Fn, + DLoc, Msg)); +} + bool DiagnosticInfoOptimizationFailure::isEnabled() const { // Only print warnings. return getSeverity() == DS_Warning; diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp index 59680f5eef5..803d24bcb76 100644 --- a/llvm/lib/IR/LLVMContext.cpp +++ b/llvm/lib/IR/LLVMContext.cpp @@ -199,6 +199,11 @@ static bool isDiagnosticEnabled(const DiagnosticInfo &DI) { if (!cast<DiagnosticInfoOptimizationRemarkAnalysis>(DI).isEnabled()) return false; break; + case llvm::DK_OptimizationRemarkAnalysisFPCommute: + if (!cast<DiagnosticInfoOptimizationRemarkAnalysisFPCommute>(DI) + .isEnabled()) + return false; + break; default: break; } |