zhi chen via llvm-dev
2016-Jan-21 01:18 UTC
[llvm-dev] Most efficient way to check if a <n x i1> vector only contains 1s
Hi all, What's is the most efficient way to check if a vectorType Value a <n x i1> only contains 1s in LLVM, where n is even? I tried to extract each element and then insert an ICmpInst with low efficiency because I didn't see a reduction operation. Is there any better way? Best, Zhi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160120/1aa380d7/attachment.html>
zhi chen via llvm-dev
2016-Jan-21 01:25 UTC
[llvm-dev] Most efficient way to check if a <n x i1> vector only contains 1s
BTW, I also used bitcast to cast <nxi1> to i_n and then compare it with a n-bit data with all 1s to check equivalence. But it seemed that it was still slow. Best, Zhi On Wed, Jan 20, 2016 at 5:18 PM, zhi chen <zchenhn at gmail.com> wrote:> Hi all, > > What's is the most efficient way to check if a vectorType Value a <n x i1> > only contains 1s in LLVM, where n is even? I tried to extract each element > and then insert an ICmpInst with low efficiency because I didn't see a > reduction operation. Is there any better way? > > Best, > Zhi >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160120/0f18cca6/attachment.html>