diff options
author | Devang Patel <dpatel@apple.com> | 2009-03-06 02:59:27 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-03-06 02:59:27 +0000 |
commit | c64bc16cae098d87aafca438adb21bc580be1db1 (patch) | |
tree | 424b04854143548918cfba2e0e610ffdc3453dc4 | |
parent | bffc86684e2d2742e6fb0757d8149189628d3760 (diff) | |
download | external_llvm-c64bc16cae098d87aafca438adb21bc580be1db1.zip external_llvm-c64bc16cae098d87aafca438adb21bc580be1db1.tar.gz external_llvm-c64bc16cae098d87aafca438adb21bc580be1db1.tar.bz2 |
Skip DbgInfoIntrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66244 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 4 | ||||
-rw-r--r-- | test/Transforms/GVN/2009-03-05-dbg.ll | 66 |
2 files changed, 68 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 727d265..6593b9c 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -21,7 +21,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" -#include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Value.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" @@ -1470,7 +1470,7 @@ bool GVN::performPRE(Function& F) { if (isa<AllocationInst>(CurInst) || isa<TerminatorInst>(CurInst) || isa<PHINode>(CurInst) || CurInst->mayReadFromMemory() || - CurInst->mayWriteToMemory()) + CurInst->mayWriteToMemory() || isa<DbgInfoIntrinsic>(CurInst)) continue; uint32_t valno = VN.lookup(CurInst); diff --git a/test/Transforms/GVN/2009-03-05-dbg.ll b/test/Transforms/GVN/2009-03-05-dbg.ll new file mode 100644 index 0000000..0450a7a --- /dev/null +++ b/test/Transforms/GVN/2009-03-05-dbg.ll @@ -0,0 +1,66 @@ +; RUN: llvm-as < %s | opt -gvn -disable-output + %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 } +@llvm.dbg.compile_unit298 = external constant %llvm.dbg.compile_unit.type ; <%llvm.dbg.compile_unit.type*> [#uses=1] + +declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind + +define i8* @__deregister_frame_info_bases(i8* %begin) { +entry: + br i1 false, label %bb17, label %bb + +bb: ; preds = %entry + br i1 false, label %bb17, label %bb6.preheader + +bb6.preheader: ; preds = %bb + br label %bb6 + +bb3: ; preds = %bb6 + br i1 false, label %bb4, label %bb6 + +bb4: ; preds = %bb3 + br label %out + +bb6: ; preds = %bb3, %bb6.preheader + br i1 false, label %bb14.loopexit, label %bb3 + +bb8: ; preds = %bb14 + br i1 false, label %bb9, label %bb11 + +bb9: ; preds = %bb8 + br i1 false, label %bb10, label %bb13 + +bb10: ; preds = %bb9 + br label %out + +bb11: ; preds = %bb8 + br i1 false, label %bb12, label %bb13 + +bb12: ; preds = %bb11 + br label %out + +bb13: ; preds = %bb11, %bb9 + br label %bb14 + +bb14.loopexit: ; preds = %bb6 + br label %bb14 + +bb14: ; preds = %bb14.loopexit, %bb13 + br i1 false, label %bb15.loopexit, label %bb8 + +out: ; preds = %bb12, %bb10, %bb4 + tail call void @llvm.dbg.stoppoint(i32 217, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit298 to { }*)) + br i1 false, label %bb15, label %bb16 + +bb15.loopexit: ; preds = %bb14 + br label %bb15 + +bb15: ; preds = %bb15.loopexit, %out + tail call void @llvm.dbg.stoppoint(i32 217, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit298 to { }*)) + unreachable + +bb16: ; preds = %out + ret i8* null + +bb17: ; preds = %bb, %entry + ret i8* null +} |