summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DiagnosticInfo.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-11-28 17:45:28 +0000
committerAdam Nemet <anemet@apple.com>2016-11-28 17:45:28 +0000
commite5112b14b9657a28c82dba921a6f57fa18559772 (patch)
treebf51fc42160e1144a698d82097aa9dbde562d2aa /llvm/lib/IR/DiagnosticInfo.cpp
parent100bc01a72f0d8892b7cf081a964ef7790e757ed (diff)
downloadbcm5719-llvm-e5112b14b9657a28c82dba921a6f57fa18559772.tar.gz
bcm5719-llvm-e5112b14b9657a28c82dba921a6f57fa18559772.zip
[GVN] Basic optimization remark support
Follow-on patches will add more interesting cases. The goal of this patch-set is to get the GVN messages printed in opt-viewer from Dhrystone as was presented in my Dev Meeting talk. This is the optimization view for the function (the last remark in the function has a bug which is fixed in this series): http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430 Differential Revision: https://reviews.llvm.org/D26488 llvm-svn: 288046
Diffstat (limited to 'llvm/lib/IR/DiagnosticInfo.cpp')
-rw-r--r--llvm/lib/IR/DiagnosticInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp
index 5618de8f602..6a3fdcff233 100644
--- a/llvm/lib/IR/DiagnosticInfo.cpp
+++ b/llvm/lib/IR/DiagnosticInfo.cpp
@@ -180,6 +180,12 @@ DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, Value *V)
DLoc = I->getDebugLoc();
}
+DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, Type *T)
+ : Key(Key) {
+ raw_string_ostream OS(Val);
+ OS << *T;
+}
+
DiagnosticInfoOptimizationBase::Argument::Argument(StringRef Key, int N)
: Key(Key), Val(itostr(N)) {}
OpenPOWER on IntegriCloud