[PATCH] D41354: [InstCombine] Extending InstructionSimplify
Omer Paparo Bivas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 21 08:05:58 PST 2017
opaparo updated this revision to Diff 127889.
opaparo added a comment.
1. Generalized InstructionSimplify's IsSafeOverflowingBinaryOperator to handle 'add', 'sub' and 'mul' in addition to 'shl'. This was done by refactoring existing behavior out of InstCombine's internals into ValueTracking, so now both InstCombine and InstructionSimplify use it.
2. Added tests to cover possible cases. For each OverflowingBinaryOperator ('shl', 'add', 'sub' and 'mul') I've created tests according to the Cartesian product of four factors: the op has the nuw flag, the op has the nsw flag, there actually is an unsigned overflow, there actually is a signed overflow. The key idea is to check that optimizations occur if and only if the overflow flag is absent or no overflow is guaranteed. also note that the file name had changed from select-bitext-bitwise-ops.ll to select-obo-peo-ops.ll to better reflect the nature of the tests it contains.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 59184 bytes
Desc: not available
More information about the llvm-commits