diff options
| author | Jun Bum Lim <junbuml@codeaurora.org> | 2016-05-13 16:52:24 +0000 |
|---|---|---|
| committer | Jun Bum Lim <junbuml@codeaurora.org> | 2016-05-13 16:52:24 +0000 |
| commit | f28beac4196167b0ca6184625bece102b0589b03 (patch) | |
| tree | 70cc1244863b11fad37c8ff58f04f3156e9f478e /llvm/test | |
| parent | e9fa3585c5929b1c5646140a5cce3f096ca64d1f (diff) | |
| download | bcm5719-llvm-f28beac4196167b0ca6184625bece102b0589b03.tar.gz bcm5719-llvm-f28beac4196167b0ca6184625bece102b0589b03.zip | |
[MemCpyOpt] Use MaxIntSize in byte instead of bit
Summary: This change fix the bug in isProfitableToUseMemset() where MaxIntSize shoule be in byte, not bit.
Reviewers: arsenm, joker.eph, mcrosier
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D20176
llvm-svn: 269433
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/MemCpyOpt/profitable-memset.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/MemCpyOpt/profitable-memset.ll b/llvm/test/Transforms/MemCpyOpt/profitable-memset.ll new file mode 100644 index 00000000000..bbef1244ee3 --- /dev/null +++ b/llvm/test/Transforms/MemCpyOpt/profitable-memset.ll @@ -0,0 +1,20 @@ +; RUN: opt < %s -memcpyopt -S | FileCheck %s + +target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" + +; CHECK-LABEL: @foo( +; CHECK-NOT: store +; CHECK: call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 8, i32 2, i1 false) + +define void @foo(i64* nocapture %P) { +entry: + %0 = bitcast i64* %P to i16* + %arrayidx = getelementptr inbounds i16, i16* %0, i64 1 + %1 = bitcast i16* %arrayidx to i32* + %arrayidx1 = getelementptr inbounds i16, i16* %0, i64 3 + store i16 0, i16* %0, align 2 + store i32 0, i32* %1, align 4 + store i16 0, i16* %arrayidx1, align 2 + ret void +} + |

