efriedma added a comment. Actually, we already have some very similar code in ARMDAGToDAGISel::ConstantMaterializationCost; can we share that code somehow? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57445/new/ https://reviews.llvm.org/D57445