Skip to content

[ValueTracking] computeKnownBitsFromOperator - improve Instruction::BitCast handling to match SelectionDAG #125228

@RKSimon

Description

@RKSimon

The middle end computeKnownBitsFromOperator can merge bitcasts from narrow vector elements to wider types, but fails to perform this in the reverse case:

https://github.com/llvm/llvm-project/blob/85d417564b5f959f7434f2657cc9e1ab3575311f/llvm/lib/Analysis/ValueTracking.cpp#L1328:L1361

The SelectionDAG implementation handles both so hopefully its just a case of reusing the additional code over and adding any missing test coverage:

https://github.com/llvm/llvm-project/blob/46befd720995647485c516ba94a49eee5548283a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp#L3662:L3706

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions