[PATCH] D47631: [ValueTracking] Match select abs pattern when there's an sext involved

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 06:26:12 PDT 2018


john.brawn created this revision.
john.brawn added reviewers: craig.topper, efriedma, hfinkel, Ka-Ka.
Herald added a reviewer: javed.absar.

When checking a select to see if it matches an abs, allow the true/false values to be a sign-extension of the comparison value instead of requiring that they're directly the comparison value, as all the comparison cares about is the sign of the value.

This fixes a regression due to r333702, where we were no longer generating ctlz due to isKnownNonNegative failing to match such a pattern.


Repository:
  rL LLVM

https://reviews.llvm.org/D47631

Files:
  lib/Analysis/ValueTracking.cpp
  test/Transforms/LoopIdiom/ARM/ctlz.ll
  test/Transforms/LoopIdiom/X86/ctlz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47631.149447.patch
Type: text/x-patch
Size: 5085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/23ef816d/attachment.bin>


More information about the llvm-commits mailing list