[PATCH/RFC] fold zext(setcc) into a larger setcc
Fiona Glaser
fglaser at apple.com
Mon Jan 26 16:35:09 PST 2015
On an out-of-tree target, IR similar to the attached causes the emission of the following instructions (pseudocode):
setcc dst16, cc
zext dst32, dst16
The attached patch fixes it to be the expected:
setcc dst32, cc
because the out-of-tree target supports 32-bit setcc.
But when testing on x86, this crashes with the assertion “Assertion failed: (((!Subtarget->hasAVX512() && VT == MVT::i8) || (VT == MVT::i1)) && "SetCC type must be 8-bit or 1-bit integer”)”. If I remove the !LegalTypes condition, it works fine, but this means that canonicalizing to a non-legal type prior to type legalization is somehow breaking x86.
Does anyone have any idea what’s going on here, or if I’m just approaching this entirely wrong?
Fiona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/8044bb24/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.ll
Type: application/octet-stream
Size: 894 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/8044bb24/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/8044bb24/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setcc_fold.diff
Type: application/octet-stream
Size: 1648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/8044bb24/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/8044bb24/attachment-0002.html>
More information about the llvm-commits
mailing list