[PATCH] D22685: Disable shrinking of SNaN constants on SystemZ

Elliot Colp via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 09:09:00 PDT 2016


colpell created this revision.
colpell added reviewers: bogner, uweigand.
colpell added a subscriber: llvm-commits.

When expanding FP constants, we attempt to shrink doubles to floats and perform an extending load.
However, on SystemZ, the FP extending load instruction converts SNaN into QNaN. So in the general case, we would still like to shrink FP constants, but SNaNs should be left as doubles on SystemZ.
The existing TargetLowering::ShouldShrinkFPConstant function only uses the EVT to determine whether to shrink, so I added a separate ShouldShrinkSNaNConstant function (defaulting to true) to deal with this case.

https://reviews.llvm.org/D22685

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/Target/SystemZ/SystemZISelLowering.h
  test/CodeGen/SystemZ/fp-const-10.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22685.65088.patch
Type: text/x-patch
Size: 3597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160722/2372448a/attachment.bin>


More information about the llvm-commits mailing list