[PATCH] D52092: [ValueTracking] Generalize isBytewiseValue into isSplatValue
Bjorn Pettersson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 20 12:20:31 PDT 2018
bjope 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);
----------------
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.
Repository:
rL LLVM
https://reviews.llvm.org/D52092
More information about the llvm-commits
mailing list