[PATCH] D89955: [ValueTracking] Recognize more integer abs idioms

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 01:18:40 PDT 2020


shchenz added a comment.

> I suppose it's possible that there was a pass between InstCombine and the SelectionDAG lowering which undid this canonicalization, but it'll be hard to find.

The issue here is there is no some instruction combine/simplify pass in llc pipeline which eliminates the `%a.prom = sext i16 %a to i32` before we canonicalize abs.

In opt pipeline, InstCombine will eliminate the `sext` first and then can recognize it as a abs.

If we compile with opt/clang which contain inst combine pass, we will get expected abs instruction.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89955/new/

https://reviews.llvm.org/D89955



More information about the llvm-commits mailing list