HomePhabricator

[InstSimplify] Simplify to vector constants when possible

Authored by aeubanks on Aug 10 2020, 12:53 PM.

Description

[InstSimplify] Simplify to vector constants when possible

InstSimplify should do all transformations that ConstProp does, but
one thing that ConstProp does that InstSimplify wouldn't is inline
vector instructions that are constants, e.g. into a ret.

Previously vector instructions wouldn't be inlined in InstSimplify
because llvm::Simplify*Instruction() would return nullptr for specific
instructions, such as vector instructions that were actually constants,
if it couldn't simplify them.

This changes SimplifyInsertElementInst, SimplifyExtractElementInst, and
SimplifyShuffleVectorInst to return a vector constant when possible.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85946

Details

Committed
aeubanksAug 26 2020, 11:40 AM
Reviewer
efriedma
Differential Revision
D85946: [InstSimplify] Simplify to vector constants when possible
Parents
rG1446c1801dea: [gn build] Manually port ed07e1fe
Branches
Unknown
Tags
Unknown