Re-apply "Use IRBuilder instead of ConstantInt methods." with the fixed issues.