Skip to content
Commit 2b587ad0 authored by Craig Topper's avatar Craig Topper
Browse files

[X86] Improve test instruction shrinking when the sign flag is used and the...

[X86] Improve test instruction shrinking when the sign flag is used and the output of the and is truncated

Currently we skip looking through truncates if the sign flag is used. But that's overly restrictive.

It's safe to look through the truncate as long as we ensure one of the 3 things when we shrink. Either the MSB of the mask at the shrunken size isn't set. If the mask bit is set then either the shrunk size needs to be equal to the compare size or the sign flag needs to be unused.

There are still missed opportunities to shrink a load and fold it in here. This will be fixed in a future patch.

Differential Revision: https://reviews.llvm.org/D52669

llvm-svn: 343498
parent e7dbb933
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment