llvm-project
bf8dae18 - [InstCombine] Narrow llvm.abs through trunc. (#199643)

Commit
3 days ago
[InstCombine] Narrow llvm.abs through trunc. (#199643) Update EvaluateInDifferentType / canEvaluateTruncated to narrow abs intrinsics when the operand has at least OrigBitWidth - BitWidth + 1 sign bits. The transform always emits the narrow abs with IsIntMinPoison=false, as the narrowed value may be INT_MIN in the narrow type, while not in the original width. Alive2 Proof with weaker precondition (top and truncated sign bits must match): https://alive2.llvm.org/ce/z/AMQRmi End-to-end C pixel math example: https://clang.godbolt.org/z/Ma8bsTGTY PR: https://github.com/llvm/llvm-project/pull/199643
Author
Parents
Loading