[PATCH] D73000: [InstCombine] Optimize strchr(cststr, C)

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 19 06:58:51 PST 2020


xbolva00 created this revision.
xbolva00 added reviewers: jdoerfert, joerg, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
xbolva00 updated this revision to Diff 238987.
xbolva00 added a comment.

up


Build chain of OR comparisons

memchr("abcd", C, 4) != NULL -> (C == 'a' | C == 'b' | C == 'c' | C == 'd') != 0


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73000

Files:
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/memchr-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73000.238987.patch
Type: text/x-patch
Size: 7734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200119/5ff08bf2/attachment-0001.bin>


More information about the llvm-commits mailing list