cdevadas wrote: The patch looks reasonable to me. As mentioned in the description, we should turn the cost values referenced in the DAGScheduler and the other place to use unsigned as well. https://github.com/llvm/llvm-project/pull/161786