diff options
| author | Dan Gohman <dan433584@gmail.com> | 2016-01-19 14:49:23 +0000 |
|---|---|---|
| committer | Dan Gohman <dan433584@gmail.com> | 2016-01-19 14:49:23 +0000 |
| commit | 055329958622d4989ad63e9a7d0dc6c9aca2e4e0 (patch) | |
| tree | 4f5ece4948f1305f0d4afaa2a90b5e2d44a41ea0 /llvm | |
| parent | d4a0d9a78ca75e441566f994f12f62302d124611 (diff) | |
| download | bcm5719-llvm-055329958622d4989ad63e9a7d0dc6c9aca2e4e0.tar.gz bcm5719-llvm-055329958622d4989ad63e9a7d0dc6c9aca2e4e0.zip | |
[WebAssembly] Re-enable loop idiom recognition for memcpy et al.
llvm-svn: 258125
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Analysis/TargetLibraryInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/WebAssembly/loop-idiom.ll | 53 |
2 files changed, 1 insertions, 56 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index ce388192562..61b05ab7482 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -70,9 +70,7 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, // There are no library implementations of mempcy and memset for AMD gpus and // these can be difficult to lower in the backend. if (T.getArch() == Triple::r600 || - T.getArch() == Triple::amdgcn || - T.getArch() == Triple::wasm32 || - T.getArch() == Triple::wasm64) { + T.getArch() == Triple::amdgcn) { TLI.setUnavailable(LibFunc::memcpy); TLI.setUnavailable(LibFunc::memset); TLI.setUnavailable(LibFunc::memset_pattern16); diff --git a/llvm/test/CodeGen/WebAssembly/loop-idiom.ll b/llvm/test/CodeGen/WebAssembly/loop-idiom.ll deleted file mode 100644 index 2a233c40690..00000000000 --- a/llvm/test/CodeGen/WebAssembly/loop-idiom.ll +++ /dev/null @@ -1,53 +0,0 @@ -; RUN: opt -loop-idiom -S < %s -march=wasm32 | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown" - - -; Make sure loop-idiom doesn't create memcpy or memset. These aren't well -; supported in WebAssembly for now. -; -; TODO Check the patterns are recognized once memcpy / memset are supported. - -; CHECK-LABEL: @cpy( -; CHECK-NOT: llvm.memcpy -; CHECK: load -; CHECK: store -define void @cpy(i64 %Size) { -bb.nph: - %Base = alloca i8, i32 10000 - %Dest = alloca i8, i32 10000 - br label %for.body - -for.body: - %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar - %DestI = getelementptr i8, i8* %Dest, i64 %indvar - %V = load i8, i8* %I.0.014, align 1 - store i8 %V, i8* %DestI, align 1 - %indvar.next = add i64 %indvar, 1 - %exitcond = icmp eq i64 %indvar.next, %Size - br i1 %exitcond, label %for.end, label %for.body - -for.end: - ret void -} - -; CHECK-LABEL: @set( -; CHECK-NOT: llvm.memset -; CHECK: store -define void @set(i8* %Base, i64 %Size) { -bb.nph: - br label %for.body - -for.body: - %indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %for.body ] - %I.0.014 = getelementptr i8, i8* %Base, i64 %indvar - store i8 0, i8* %I.0.014, align 1 - %indvar.next = add i64 %indvar, 1 - %exitcond = icmp eq i64 %indvar.next, %Size - br i1 %exitcond, label %for.end, label %for.body - -for.end: - ret void -} |

