mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
isBytewiseValue checks ConstantVector element by element
Summary: Vector of the same value with few undefs will sill be considered "Bytewise" Reviewers: eugenis, pcc, jfb Reviewed By: jfb Subscribers: dexonsmith, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64031 llvm-svn: 365971
This commit is contained in:
parent
2b74d7bbd0
commit
efa8f57b0d
@ -3253,12 +3253,7 @@ Value *llvm::isBytewiseValue(Value *V, const DataLayout &DL) {
|
||||
return Val;
|
||||
}
|
||||
|
||||
if (isa<ConstantVector>(C)) {
|
||||
Constant *Splat = cast<ConstantVector>(C)->getSplatValue();
|
||||
return Splat ? isBytewiseValue(Splat, DL) : nullptr;
|
||||
}
|
||||
|
||||
if (isa<ConstantArray>(C) || isa<ConstantStruct>(C)) {
|
||||
if (isa<ConstantAggregate>(C)) {
|
||||
Value *Val = UndefInt8;
|
||||
for (unsigned I = 0, E = C->getNumOperands(); I != E; ++I)
|
||||
if (!(Val = Merge(Val, isBytewiseValue(C->getOperand(I), DL))))
|
||||
|
@ -878,7 +878,7 @@ const std::pair<const char *, const char *> IsBytewiseValueTests[] = {
|
||||
"<4 x i8> <i8 1, i8 1, i8 2, i8 1>",
|
||||
},
|
||||
{
|
||||
"",
|
||||
"i8 5",
|
||||
"<2 x i8> < i8 5, i8 undef >",
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user