[PATCH] D54237: Constant folding and instcombine for saturating adds

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 08:57:51 PST 2018


nikic added a comment.

I've now split this up in separate patches, separated the tests for constant folding, instruction simplify and instcombine and added tests for vector operations. The patches are now (with the add/sub cases combined):

- https://reviews.llvm.org/D54332 - APInt support
- https://reviews.llvm.org/D54531 - Constant folding support
- https://reviews.llvm.org/D54532 - Instruction simplify support
- https://reviews.llvm.org/D54534 - InstCombine support

I did not change any of the code, only the tests. Vectors to the most part work out of the box. The only thing that does not work with vectors are sat(sat(X + C1) + C2) -> sat(X + (C1 + C2)) simplifications where C1 and C2 are not constant splats. It would be possible to support this, but I'm not sure it's worth the extra complexity. From looking at the surrounding codes it seems like nothing else tries to handle the non-splat case either.


https://reviews.llvm.org/D54237





More information about the llvm-commits mailing list