[PATCH] D68103: [InstCombine] Simplify shift-by-sext to shift-by-zext

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 03:50:53 PDT 2019


lebedev.ri updated this revision to Diff 222124.
lebedev.ri added a comment.

Revisited tests.

We can quite easily have more than one shift by the same `sext`.
I'm not quite sure where the fix for that should be.
Here i'm proposing to do that in instcombine, by checking
that all uses of such `sext` are shifts.
This is obviously O(N^2) iff the `sext` is also used by a non-shift.
Thoughts?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68103

Files:
  llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
  llvm/test/Transforms/InstCombine/load-cmp.ll
  llvm/test/Transforms/InstCombine/shift-by-signext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68103.222124.patch
Type: text/x-patch
Size: 5401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190927/ab199c26/attachment.bin>


More information about the llvm-commits mailing list