[PATCH] D52092: [ValueTracking] Generalize isBytewiseValue into isSplatValue
JF Bastien via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 20 12:32:24 PDT 2018
jfb added inline comments.
================
Comment at: include/llvm/Analysis/ValueTracking.h:229
+ /// truncated to one byte. Otherwise return null.
+ inline Value *isBytewiseValue(Value *V) {
+ return isSplatValue(V, 8);
----------------
bjope wrote:
> jfb wrote:
> > Your target has 16-bit bytes, shouldn't this function (with your change) call `isSplatValue(V, 16)` in your target?
> Correct! We are actually doing `return isSplatValue(V, DataLayout::getBitsPerByte());` in our llvm fork. But I can't do that in llvm trunk, because there is currently no way to ask for getBitsPerByte().
>
> Currently we also need to implement/maintain our own version of isSplatValue, because the existing isBytewiseValue function in llvm trunk is not general enough.
Do you have plans to upstream your fork? It's otherwise pretty difficult to semi-support it, and it'll break very easily with changes that are useful to the LLVM community. It sounds like you're trying to incrementally get to a point where you can upstream?
Repository:
rL LLVM
https://reviews.llvm.org/D52092
More information about the llvm-commits
mailing list