diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-06 03:26:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-06 03:26:38 +0000 |
commit | fe386c4759cce2ea3eb2e664f27ee391b8acb37b (patch) | |
tree | fe1bffabfbb195e852b5e76c183261008c2de7f5 /test/Transforms/TailDup | |
parent | 523001f1bb8e9b38a68813c083daf1fa0ce22c5f (diff) | |
download | external_llvm-fe386c4759cce2ea3eb2e664f27ee391b8acb37b.zip external_llvm-fe386c4759cce2ea3eb2e664f27ee391b8acb37b.tar.gz external_llvm-fe386c4759cce2ea3eb2e664f27ee391b8acb37b.tar.bz2 |
When tail duplicating these functions, the add instruction should not be
duplicated, even though the block it is in is duplicated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/TailDup')
-rw-r--r-- | test/Transforms/TailDup/MergeTest.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Transforms/TailDup/MergeTest.ll b/test/Transforms/TailDup/MergeTest.ll new file mode 100644 index 0000000..ef6fe07 --- /dev/null +++ b/test/Transforms/TailDup/MergeTest.ll @@ -0,0 +1,31 @@ +; RUN: llvm-as < %s | opt -tailduplicate | llvm-dis | grep add | not grep uses=1 + +int %test1(bool %C, int %A, int* %P) { +entry: + br bool %C, label %L1, label %L2 + +L1: + store int 1, int* %P + br label %L2 + +L2: + %X = add int %A, 17 + ret int %X +} + +int %test2(bool %C, int %A, int* %P) { +entry: + br bool %C, label %L1, label %L2 + +L1: + store int 1, int* %P + br label %L3 + +L2: + store int 7, int* %P + br label %L3 +L3: + %X = add int %A, 17 + ret int %X +} + |