summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-11-11 15:34:13 +0000
committerDuncan Sands <baldrick@free.fr>2009-11-11 15:34:13 +0000
commitba61fed5d35f137f1c29d6b4ee96de7930f9d700 (patch)
treea7e6d07f8bf01883c873cd790c743e91a43ac493 /llvm/lib/Transforms/Utils/Local.cpp
parentb166712d025d7e44948b614f591e631f763604f4 (diff)
downloadbcm5719-llvm-ba61fed5d35f137f1c29d6b4ee96de7930f9d700.tar.gz
bcm5719-llvm-ba61fed5d35f137f1c29d6b4ee96de7930f9d700.zip
Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. llvm-svn: 86840
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 0167ea0bcb2..aef0f5f03c2 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -252,6 +252,9 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
// We don't want debug info removed by anything this general.
if (isa<DbgInfoIntrinsic>(I)) return false;
+ // Likewise for memory use markers.
+ if (isa<MemoryUseIntrinsic>(I)) return false;
+
if (!I->mayHaveSideEffects()) return true;
// Special case intrinsics that "may have side effects" but can be deleted
OpenPOWER on IntegriCloud