On Jun 8, 2012, at 3:18 PM, Linus Torvalds wrote: > On Fri, Jun 8, 2012 at 12:10 PM, Pekka Enberg <penberg@xxxxxxxxxx> wrote: >> >> So it seems that LLVM really wants to use the "getelementptr" thingy >> for these. I have no idea what makes the most sense from sparse IR >> point of view. > > I think the right thing to do is as an EXPR_BINOP with a > "SPECIAL_ADDPTR" operation which takes a pointer and a (pre-scaled) > 'long'. > > From a code generation and optimization standpoint, OP_ADDPTR would be > the same as '+' Not sure we really need getelementptr. What I am doing now is to convert all operands to integers first, perform the addition, and then convert the result back to pointer. Anything wrong with that? - xi -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html