Improve codegen for intrinsics