[PATCH] D29489: Optimize SETCC + VSEL of incompatible or illegal types
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 03:47:55 PST 2017
jonpa updated this revision to Diff 87208.
jonpa added a comment.
> It seems like it would be simpler to produce the correct code in the first place, rather than vectorize the result which was scalarized by legalization.
I agree, so this time I have tried to do it during type legalization.
> This doesn't make any sense; you can't assume an arbitrary vector is all zeros or all ones.
I was hoping maybe some check might make this legal. Anyway, this isn't needed anymore because the extend is not anymore generated in the first place.
I made a new method that handles VSELECT early and get the same results as with the previous version of the patch, in a simpler way. This is basically an extension of the handling of VSELECT during type legalization. I am not sure of what the best place to insert this function would be, but currently I need to call it from both PromoteIntOp_SELECT() and WidenVecRes_SELECT(), both called on the VSELECT.
Again, this patch is at a stage where I get the needed results, but where there might be missing legality checks and so on. This might even have to go into a custom lowering for the SystemZ backend if this disrupts other targets somehow.
Regression tests are now failing, but I would appreciate more feedback at this point.
https://reviews.llvm.org/D29489
Files:
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeTypes.h
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29489.87208.patch
Type: text/x-patch
Size: 4235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170206/eebcd0cf/attachment.bin>
More information about the llvm-commits
mailing list