OSDN Git Service

[SystemZ] Improved handling of the @llvm.ctlz intrinsic.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 6 Feb 2019 19:23:31 +0000 (19:23 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 6 Feb 2019 19:23:31 +0000 (19:23 +0000)
commit0e5a5025819ccaed58c0acea310c46b2812f2271
tree374f29ed29c6ccb96678cad3e696d2c0e0c2d560
parent7cc46527c2452001a0c0e2d1bd912abaf7d45ca4
[SystemZ]  Improved handling of the @llvm.ctlz intrinsic.

Since SystemZ supports counting of leading zeros with the FLOGR instruction,
isCheapToSpeculateCtlz() should return true, which it now does.

ISD::CTLZ_ZERO_UNDEF i32 is now handled the same way as ISD::CTLZ is, which
is needed since promotion to i64 is required and CTLZ_ZERO_UNDEF is only
expanded to CTLZ if it is Legal or Custom.

Review: Ulrich Weigand
https://reviews.llvm.org/D57710

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353330 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
test/CodeGen/SystemZ/scalar-ctlz.ll [new file with mode: 0644]