This is an archive of the discontinued LLVM Phabricator instance.

[X86][btver2] PR31902: Fix a crash in combineOrCmpEqZeroToCtlzSrl under fast math.
ClosedPublic

Authored by pgousseau on Feb 9 2017, 3:56 AM.

Details

Summary

In combineOrCmpEqZeroToCtlzSrl, replace "getConstantOperand == 0" by "isNullConstant" to account for floating point constants.

Diff Detail

Repository
rL LLVM

Event Timeline

pgousseau created this revision.Feb 9 2017, 3:56 AM
andreadb accepted this revision.Feb 9 2017, 4:07 AM

Basically, there is no guarantee that N->getOperand(1) is an integer value.

LGTM.

This revision is now accepted and ready to land.Feb 9 2017, 4:07 AM
spatel added inline comments.Feb 9 2017, 6:21 AM
test/CodeGen/X86/lzcnt-zext-cmp.ll
4–7 ↗(On Diff #87785)

An opportunity to make this easier to read (as a separate patch): add a common prefix for all runs ("ALL") and rerun the script. That way it will be obvious which tests expect no transformation.

pgousseau added inline comments.Feb 9 2017, 6:39 AM
test/CodeGen/X86/lzcnt-zext-cmp.ll
4–7 ↗(On Diff #87785)

Makes sense, will have a look!

This revision was automatically updated to reflect the committed changes.