As the market continues to move higher, finding great deals is only getting harder. Don't give up on searching for value, though. Even in an expensive market, good stocks sometimes go on sale. When they do, you need to pounce on them quickly. Otherwise, you'll miss out.

Carmaker General Motors (GM 4.37%) and apparel manufacturer Hanesbrands (HBI 7.69%) stand out to me as two solid stocks trading at discounted valuations. I own both stocks, so I'm putting my money where my mouth is. Here's why GM and Hanesbrands have places in my portfolio.

Bold moves and big profits

Things are changing in the auto industry. After a strong post-recession recovery lasting seven years, U.S. auto sales appear to have peaked, dropping slightly in 2017. The bonanza looks to be over. On top of that, electric cars are charging into the mainstream, accelerated by Tesla's hyped-up Model 3. And autonomous driving technology, which is being worked on by countless companies, has the potential to drastically alter the car ownership model.

GM's Cruise AV autonomous car.

GM's Cruise AV autonomous car. Image source: GM.

These developments may have pushed you away from even considering buying shares of General Motors, but that would be a mistake. The company's profits have boomed over the past few years, and GM expects the bottom line to hold steady in 2018. GM sees adjusted earnings between $6.00 and $6.50 per share in 2017, and it expects 2018 results to be in-line with 2017 results. At the midpoint of that guidance range, GM stock trades for 7 times earnings and comes with a hearty 3.5% dividend yield.

GM isn't going to let itself be disrupted. The company launched the all-electric Chevy Bolt ahead of the Model 3, with sales steadily ramping up throughout 2017. GM moved about 23,000 units in the U.S. last year, beaten only by the high-end Model S. The Bolt is only the first chapter in GM's foray into electric vehicles. The company plans to launch 20 new all-electric vehicles by 2023, with two expected within the next 18 months. There's no reason to believe that GM will be steamrolled by the money-burning, manufacturing-challenged Tesla.

On the autonomous car front, GM isn't sitting on its hands, either. The company acquired Cruise Automation back in 2016, and it plans to roll out an autonomous ride-hailing service in dense urban environments as early as 2019. The Cruise AV, which is based on the Chevy Bolt, will be the car that powers this service.

GM sees the future coming, and it's making sure it won't be blindsided. GM is not only a cheap stock with a solid dividend, but it's also well positioned to thrive as the auto industry evolves.

An unloved apparel stock

While apparel companies like Under Armour get a lot of attention from investors, there's value to be found by looking under the radar. Hanesbrands, a manufacturer of basic apparel, is a great example. The company's stable of brands includes Hanes, Champion, and Playtex. According to Hanesbrands, nearly 90% of U.S. households contain its products.

The Hanes logo.

Image source: Hanesbrands.

Shares of Hanesbrands have not done well over the past few years. Since peaking in early 2015, the stock has tumbled about 37%. That's despite both revenue and earnings marching higher. Over the past twelve months, Hanesbrands produced $6.4 billion of revenue, $604 million of net income, and $1.61 of earnings per share. That puts the P/E ratio at an attractive 13.7.

Hanesbrands' core innerwear business is struggling, but activewear and the international business is picking up the slack. In the third quarter of 2017, while innerwear sales slumped 5% year over year, activewear sales rose 1% and international sales jumped 16%. The company achieved positive organic revenue growth, and it expects to do it again in the fourth quarter.

There's plenty that could go wrong for Hanesbrands. The ongoing disruption of the retail industry by e-commerce will certainly test the company. In fiscal 2016, Hanesbrands derived 20% of its revenue from Wal-Mart and 15% of its revenue from Target. The company has its own online business that's growing at a double-digit rate, but it will certainly face challenges navigating a changing retail landscape. Hanesbrands balance sheet could also be a problem. The company had $3.57 billion of long-term debt at the end of the third-quarter.

Hanesbrands is a cheap stock in an expensive market. It also pays a nice 2.7% dividend, far higher than the middling yield of the S&P 500. There are risks, but Hanesbrands stock looks like a good idea to me.