mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Constant fold extractelement(zero, x) -> zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27479 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8960766d45
commit
f38d471445
@ -836,6 +836,9 @@ Constant *llvm::ConstantFoldExtractElementInstruction(const Constant *Val,
|
||||
const Constant *Idx) {
|
||||
if (isa<UndefValue>(Val)) // ee(undef, x) -> undef
|
||||
return UndefValue::get(cast<PackedType>(Val->getType())->getElementType());
|
||||
if (Val->isNullValue()) // ee(zero, x) -> zero
|
||||
return Constant::getNullValue(
|
||||
cast<PackedType>(Val->getType())->getElementType());
|
||||
|
||||
if (const ConstantPacked *CVal = dyn_cast<ConstantPacked>(Val)) {
|
||||
if (const ConstantUInt *CIdx = dyn_cast<ConstantUInt>(Idx)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user