[PATCH] D73000: [InstCombine] Optimize strchr(cststr, C)
Joerg Sonnenberger via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 10:54:12 PST 2020
joerg added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:935
// It would be really nice to reuse switch lowering here but we can't change
// the CFG at this point.
//
----------------
We are planning on doing exactly that, so the above comment needs adjustment?
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:948
// target.
- // FIXME: On a 64 bit architecture this prevents us from using the
- // interesting range of alpha ascii chars. We could do better by emitting
- // two bitfields or shifting the range by 64 if no lower chars are used.
- if (!DL.fitsInLegalInteger(Max + 1))
- return nullptr;
+ if (!DL.fitsInLegalInteger(Max + 1)) {
+ // Build chain of OR comparisons
----------------
The switch table logic is fine with lowering it to a multiple tests, isn't it?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73000/new/
https://reviews.llvm.org/D73000
More information about the llvm-commits
mailing list