ychen added a comment. In D129954#3658139 <https://reviews.llvm.org/D129954#3658139>, @nikic wrote:
> Hm, might it be better to teach LLVM about this (in some > ConstantRange/KnownBits logic)? This doesn't really seem like something the > frontend should know about and encode, as that means each frontend has to add > this annotation by itself. Agreed that teaching LLVM about his saves other frontends from doing the same thing. The information is inline asm semantic defined by GCC extension though, I think putting it in the frontend is a valid choice and makes the implementation easy. I looked into where to put this in LLVM. It seems nontrivial: existing ConstantRanges are computed from binary-op/comparsion etc. Inferring range from an inline asm call is something passes (LazyValueInfo) need to learn, with some kinds of def-use chain walking. That said, I'm definitely new to ConstantRange analysis, it may well be that this is not that hard to implement. Could you please give some guidance? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129954/new/ https://reviews.llvm.org/D129954 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits