diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-08 22:18:29 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-08 22:18:29 +0000 |
commit | 7065a2bcec3b775da12cf8fbcd6fa972d5f2afeb (patch) | |
tree | 276d88553d0be34537f6e3317cdf00f092bde9d2 /test/Transforms/LoopIdiom | |
parent | 0c66e07863f2bcb054ffc4d58ae30a048b7406c7 (diff) | |
download | llvm-7065a2bcec3b775da12cf8fbcd6fa972d5f2afeb.tar.gz llvm-7065a2bcec3b775da12cf8fbcd6fa972d5f2afeb.tar.bz2 llvm-7065a2bcec3b775da12cf8fbcd6fa972d5f2afeb.tar.xz |
Revert the patches adding a popcount loop idiom recognition pass.
There are still bugs in this pass, as well as other issues that are
being worked on, but the bugs are crashers that occur pretty easily in
the wild. Test cases have been sent to the original commit's review
thread.
This reverts the commits:
r169671: Fix a logic error.
r169604: Move the popcnt tests to an X86 subdirectory.
r168931: Initial commit adding the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopIdiom')
-rw-r--r-- | test/Transforms/LoopIdiom/X86/lit.local.cfg | 6 | ||||
-rw-r--r-- | test/Transforms/LoopIdiom/X86/popcnt.ll | 76 |
2 files changed, 0 insertions, 82 deletions
diff --git a/test/Transforms/LoopIdiom/X86/lit.local.cfg b/test/Transforms/LoopIdiom/X86/lit.local.cfg deleted file mode 100644 index a8ad0f1a28..0000000000 --- a/test/Transforms/LoopIdiom/X86/lit.local.cfg +++ /dev/null @@ -1,6 +0,0 @@ -config.suffixes = ['.ll', '.c', '.cpp'] - -targets = set(config.root.targets_to_build.split()) -if not 'X86' in targets: - config.unsupported = True - diff --git a/test/Transforms/LoopIdiom/X86/popcnt.ll b/test/Transforms/LoopIdiom/X86/popcnt.ll deleted file mode 100644 index 039af8024d..0000000000 --- a/test/Transforms/LoopIdiom/X86/popcnt.ll +++ /dev/null @@ -1,76 +0,0 @@ -; RUN: opt -loop-idiom < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -S | FileCheck %s - -;To recognize this pattern: -;int popcount(unsigned long long a) { -; int c = 0; -; while (a) { -; c++; -; a &= a - 1; -; } -; return c; -;} -; -; CHECK: entry -; CHECK: llvm.ctpop.i64 -; CHECK: ret -define i32 @popcount(i64 %a) nounwind uwtable readnone ssp { -entry: - %tobool3 = icmp eq i64 %a, 0 - br i1 %tobool3, label %while.end, label %while.body - -while.body: ; preds = %entry, %while.body - %c.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] - %a.addr.04 = phi i64 [ %and, %while.body ], [ %a, %entry ] - %inc = add nsw i32 %c.05, 1 - %sub = add i64 %a.addr.04, -1 - %and = and i64 %sub, %a.addr.04 - %tobool = icmp eq i64 %and, 0 - br i1 %tobool, label %while.end, label %while.body - -while.end: ; preds = %while.body, %entry - %c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] - ret i32 %c.0.lcssa -} - -; To recognize this pattern: -;int popcount(unsigned long long a, int mydata1, int mydata2) { -; int c = 0; -; while (a) { -; c++; -; a &= a - 1; -; mydata1 *= c; -; mydata2 *= (int)a; -; } -; return c + mydata1 + mydata2; -;} -; CHECK: entry -; CHECK: llvm.ctpop.i64 -; CHECK: ret -define i32 @popcount2(i64 %a, i32 %mydata1, i32 %mydata2) nounwind uwtable readnone ssp { -entry: - %tobool9 = icmp eq i64 %a, 0 - br i1 %tobool9, label %while.end, label %while.body - -while.body: ; preds = %entry, %while.body - %c.013 = phi i32 [ %inc, %while.body ], [ 0, %entry ] - %mydata2.addr.012 = phi i32 [ %mul1, %while.body ], [ %mydata2, %entry ] - %mydata1.addr.011 = phi i32 [ %mul, %while.body ], [ %mydata1, %entry ] - %a.addr.010 = phi i64 [ %and, %while.body ], [ %a, %entry ] - %inc = add nsw i32 %c.013, 1 - %sub = add i64 %a.addr.010, -1 - %and = and i64 %sub, %a.addr.010 - %mul = mul nsw i32 %inc, %mydata1.addr.011 - %conv = trunc i64 %and to i32 - %mul1 = mul nsw i32 %conv, %mydata2.addr.012 - %tobool = icmp eq i64 %and, 0 - br i1 %tobool, label %while.end, label %while.body - -while.end: ; preds = %while.body, %entry - %c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] - %mydata2.addr.0.lcssa = phi i32 [ %mydata2, %entry ], [ %mul1, %while.body ] - %mydata1.addr.0.lcssa = phi i32 [ %mydata1, %entry ], [ %mul, %while.body ] - %add = add i32 %mydata2.addr.0.lcssa, %mydata1.addr.0.lcssa - %add2 = add i32 %add, %c.0.lcssa - ret i32 %add2 -} - |