RKSimon wrote: Have you looked at doing this in SelectionDAGBuilder with the other AssertZExt/AssertSExt handling? Ideally this needs to be attached to the corresponding CopyFromRegs node. https://github.com/llvm/llvm-project/pull/172046