summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorPiotr Padlewski <prazek@google.com>2015-08-25 01:34:15 +0000
committerPiotr Padlewski <prazek@google.com>2015-08-25 01:34:15 +0000
commit4e7f752bb8424936857dfb47c8e8000edc50d2e8 (patch)
tree0652a10f703e63015f995eb41921fc04c83b5f5a /llvm/lib/Transforms
parentfb65a3a657daec596ee0380a20797b2855efd17f (diff)
downloadbcm5719-llvm-4e7f752bb8424936857dfb47c8e8000edc50d2e8.tar.gz
bcm5719-llvm-4e7f752bb8424936857dfb47c8e8000edc50d2e8.zip
Assume intrinsic handling in global opt
It doesn't solve the problem, when for example we load something, and then assume that it is the same as some constant value, because globalopt will fail on unknown load instruction. The proposed solution would be to skip some instructions that we can't evaluate and they are safe to skip (f.e. load, assume and many others) and see if they are required to perform optimization (f.e. we don't care about ephemeral instructions that may appear using @llvm.assume()) http://reviews.llvm.org/D12266 llvm-svn: 245919
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index af19e7d3b4e..c60b3ccc298 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2504,6 +2504,10 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst,
// Continue even if we do nothing.
++CurInst;
continue;
+ } else if (II->getIntrinsicID() == Intrinsic::assume) {
+ DEBUG(dbgs() << "Skipping assume intrinsic.\n");
+ ++CurInst;
+ continue;
}
DEBUG(dbgs() << "Unknown intrinsic. Can not evaluate.\n");
OpenPOWER on IntegriCloud