The getIntMatCost function calculates the cost of instruction sequence in two different scale factor, which depends on the bool CompressionCost argument. The getInstSeqCost function uses 100 as multiply factor value, no matter RVC is enable.
Then, getIntMatCost is used in getIntImmCost function with CompressionCost = false to get num of instructions to get Imm cost. And it's also used in isDesirableToCommuteWithShift with CompressionCost = true to get the cost with balancing the codesize benefit of RVC.
HasRVC also considers ‘CompressionCost’ so it only scaled the value when that was passed. TargetTransformInfo doesn’t set that flag.