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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 28 13:11:05 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.

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.

It looks like there are still missed opportunities to shrink a load and fold it in here.


https://reviews.llvm.org/D52669

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll
  test/CodeGen/X86/test-shrink.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52669.167535.patch
Type: text/x-patch
Size: 8995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180928/8821ae29/attachment.bin>


More information about the llvm-commits mailing list