[llvm] [ValueTracking] Try to infer range of select from true and false values. (PR #68256)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 00:41:34 PDT 2023


https://github.com/nikic commented:

I'm okay with this, but please keep this comment in mind:
https://github.com/llvm/llvm-project/blob/5c4d35d8cfd00885f98b5a863612a5194d235a10/llvm/include/llvm/Analysis/ValueTracking.h#L903-L904

If computeConstantRange() gets expanded substantially beyond this (e.g. if we did recursive binop calculations, which we currently intentionally don't do), then we'll have to re-evaluate how and where this function gets used. Being "essentially free" is part of its current feature set.

https://github.com/llvm/llvm-project/pull/68256


More information about the llvm-commits mailing list