Skip to content

[VectorCombine] Generalise foldBitOpOfBitcasts into foldBitOpOfCastops #146037

@RKSimon

Description

@RKSimon

foldBitOpOfBitcasts (#137322) allows us to fold bitlogic(bitcast(x),bitcast(y)) -> bitcast(bitlogic(x,y)) if x and y are the same type and it doesn't cost anymore.

We can generalise this to work with other matching cast ops (trunc/sext/zext) - similar to how foldShuffleOfCastops works (although much simpler as there's no shuffle mask manipulation to do).

Metadata

Metadata

Assignees

Labels

good first issuehttps://github.com/llvm/llvm-project/contributellvm::vectorcombineCost-based vector combine pass

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions