Thanks! It was the ARM back end which alerted me to the possibility of doing this. It’s great to have confirmation that generating conversion code within the call lowering is considered reasonable.
It appears that CallingConv.td is used to declare what the lowering code will do and the function lowering is the place to actually do it. The CCCustom API certainly makes more sense with the example.
Cheers