Catello Cioffi via llvm-dev
2017-Jan-24 15:22 UTC
[llvm-dev] Creating a pattern detection pass for Mips backend
HI all, I'm trying to add a new FunctionPas to Mips backend in order to recognise a specific loop and substitute it with an intrinsic. The pattern that I want to recognise is: %7 = load i32, i32* %i, align 4 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* %seq, i32 0, i32 %7 %8 = load i32, i32* %arrayidx, align 4 %9 = load i32, i32* %j, align 4 %mul = mul nsw i32 %9, 2 %shl = shl i32 3, %mul %and = and i32 %8, %shl %10 = load i32, i32* %j, align 4 %mul2 = mul nsw i32 %10, 2 %shr = ashr i32 %and, %mul2 %conv = trunc i32 %shr to i8 store i8 %conv, i8* %hn, align 1 %11 = load i8, i8* %hn, align 1 %conv3 = sext i8 %11 to i32 %cmp4 = icmp eq i32 %conv3, 2 br i1 %cmp4, label %12, label %14 ; <label>:12: ; preds = %6 %13 = load i32, i32* %cnt, align 4 %inc = add nsw i32 %13, 1 store i32 %inc, i32* %cnt, align 4 br label %14 How can I detect it? There is a similar thing in other backends that I can use for my purpose? Thanks, Catello -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170124/16eb4573/attachment.html>
Friedman, Eli via llvm-dev
2017-Jan-24 18:06 UTC
[llvm-dev] Creating a pattern detection pass for Mips backend
On 1/24/2017 7:22 AM, Catello Cioffi via llvm-dev wrote:> HI all, > > I'm trying to add a new FunctionPas to Mips backend in order to > recognise a specific loop and substitute it with an intrinsic.Please don't start a new thread with the same question; if the answers to your previous thread don't seem to answer your question, you can reply there and clarify what you're asking. -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project