Deepak Rajendrakumaran via llvm-dev
2021-Jan-23 02:48 UTC
[llvm-dev] Compiler hint for vectors.
Hello, I'm thinking of adding 'llvm.assume' intrinsics into the IR as optimization hints . It works great for scalar values. However I have a number of use cases where I deal with vector conditions. Assuming I have '<8 x i1> %cond' 1. Is there an option other than looping and calling llvm.assume for each scalar value? 2. Another open question is, if there any point in introducing the above loop if that's the only option i.e, are the relevant optimizations likely to kick in this way? p.s. I'll obviously check this out but it'll to good to hear if anyone has any experience/opinion. Regards, Deepak -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210122/1e00ffcb/attachment.html>
Deepak Rajendrakumaran via llvm-dev <llvm-dev at lists.llvm.org> writes:> I'm thinking of adding 'llvm.assume' intrinsics into the IR as optimization > hints . It works great for scalar values. However I have a number of use > cases where I deal with vector conditions. Assuming I have '<8 x i1> %cond' > > 1. Is there an option other than looping and calling llvm.assume for each > scalar value?Maybe? What kinds of patterns are you looking for? You could do various reductions on the i1 vector to detect all 1's/0's, parity, popcount, etc. Your targeted optimizations would have to understand the expressions you construct of course.> 2. Another open question is, if there any point in introducing the above > loop if that's the only option i.e, are the relevant optimizations likely > to kick in this way? p.s. I'll obviously check this out but it'll to good > to hear if anyone has any experience/opinion.That's impossible to say without understanding the use cases for vector assume. -David