Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
llvm.7809
backport-llvm-r233736
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File backport-llvm-r233736 of Package llvm.7809
------------------------------------------------------------------------ r233736 | uweigand | 2015-03-31 21:28:50 +0200 (Tue, 31 Mar 2015) | 9 lines [SystemZ] Address review comments for r233689 Change lowerCTPOP to: - Gracefully handle a known-zero input value - Simplify computation of significant bit size Thanks to Jay Foad for the review! ------------------------------------------------------------------------ Index: lib/Target/SystemZ/SystemZISelLowering.cpp =================================================================== --- lib/Target/SystemZ/SystemZISelLowering.cpp.orig +++ lib/Target/SystemZ/SystemZISelLowering.cpp @@ -2321,12 +2321,13 @@ SDValue SystemZTargetLowering::lowerCTPO Op = Op.getOperand(0); APInt KnownZero, KnownOne; DAG.ComputeMaskedBits(Op, KnownZero, KnownOne); - uint64_t Mask = ~KnownZero.getZExtValue(); + unsigned NumSignificantBits = (~KnownZero).getActiveBits(); + if (NumSignificantBits == 0) + return DAG.getConstant(0, VT); // Skip known-zero high parts of the operand. - int64_t BitSize = OrigBitSize; - while ((Mask & ((((uint64_t)1 << (BitSize / 2)) - 1) << (BitSize / 2))) == 0) - BitSize = BitSize / 2; + int64_t BitSize = (int64_t)1 << Log2_32_Ceil(NumSignificantBits); + BitSize = std::min(BitSize, OrigBitSize); // The POPCNT instruction counts the number of bits in each byte. Op = DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64, Op);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor