[IRBuilder] Migrate all binops to folding API
Migrate all binops to use FoldXYZ rather than CreateXYZ APIs, which are compatible with InstSimplifyFolder and fallible constant folding. Rather than continuing to add one method for every single operator, add a generic FoldBinOp (plus variants for nowrap, exact and fmf operators), which we would need anyway for CreateBinaryOp. This change is not NFC because IRBuilder with InstSimplifyFolder may perform more folding. However, this patch changes SCEVExpander to not use the folder in InsertBinOp to minimize practical impact and keep this change as close to NFC as possible.
Loading
Please sign in to comment