llvm-project
65e2a60f - [IRBuilder] Handle byte types in CreateBitPreservingCastChain (#209557)

Commit
79 days ago
[IRBuilder] Handle byte types in CreateBitPreservingCastChain (#209557) `CreateBitPreservingCastChain` only routed conversions through an `inttoptr`/`ptrtoint` step when the non-pointer side was an integer or integer vector. Byte and byte-vector types are not integer types, so a byte/byte-vector to pointer conversion fell through to a plain bitcast, producing an invalid bitcast between a non-pointer aggregate and a pointer (e.g. `bitcast <2 x b32> to ptr`). This manifested as a MachineVerifier "bitcast cannot convert between pointers and other types" failure once a pass fed byte element types into the cast chain. This patch treats byte and byte-vector types the same as integers here so the conversion goes through a pointer-sized integer. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
Parents
Loading