mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
basic instcombine support for CDS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -16,7 +16,8 @@
|
||||
using namespace llvm;
|
||||
|
||||
/// CheapToScalarize - Return true if the value is cheaper to scalarize than it
|
||||
/// is to leave as a vector operation.
|
||||
/// is to leave as a vector operation. isConstant indicates whether we're
|
||||
/// extracting one known element. If false we're extracting a variable index.
|
||||
static bool CheapToScalarize(Value *V, bool isConstant) {
|
||||
if (isa<ConstantAggregateZero>(V))
|
||||
return true;
|
||||
@ -335,10 +336,14 @@ static Value *CollectShuffleElements(Value *V, std::vector<Constant*> &Mask,
|
||||
if (isa<UndefValue>(V)) {
|
||||
Mask.assign(NumElts, UndefValue::get(Type::getInt32Ty(V->getContext())));
|
||||
return V;
|
||||
} else if (isa<ConstantAggregateZero>(V)) {
|
||||
}
|
||||
|
||||
if (isa<ConstantAggregateZero>(V)) {
|
||||
Mask.assign(NumElts, ConstantInt::get(Type::getInt32Ty(V->getContext()),0));
|
||||
return V;
|
||||
} else if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(V)) {
|
||||
}
|
||||
|
||||
if (InsertElementInst *IEI = dyn_cast<InsertElementInst>(V)) {
|
||||
// If this is an insert of an extract from some other vector, include it.
|
||||
Value *VecOp = IEI->getOperand(0);
|
||||
Value *ScalarOp = IEI->getOperand(1);
|
||||
|
Reference in New Issue
Block a user