This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix select of and (PR40805)
ClosedPublic

Authored by nikic on Feb 23 2019, 2:46 AM.

Details

Summary

Fixes https://bugs.llvm.org/show_bug.cgi?id=40805 introduced by patterns added in D53676.

I'm removing the patterns entirely here, as they are not correct in the general case, but maybe they still can/need to be salvaged for more specific cases. I'm not sure whether or not the code that was previously generated for non-zeroext i1 params was correct -- I couldn't find information on what the semantics of an i1 parameter without zeroext/signext is. My guess is that it is anyext by default, which means that the explicit masking is necessary there for correctness.

Diff Detail

Event Timeline

nikic created this revision.Feb 23 2019, 2:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2019, 2:46 AM
tlively accepted this revision.Feb 23 2019, 7:13 AM

Thanks for tracking that down. You’re totally right that the pattern was wrong generally, although it still applies to legalized i1s. Since we don’t have access to legalization history in selection dags, I think we will want to reintroduce this optimization more selectively in WebAssemblyISelDAGLowering.

Feel free to commit this, or let me know if you don’t have commit privileges and I can land it for you.

This revision is now accepted and ready to land.Feb 23 2019, 7:13 AM
This revision was automatically updated to reflect the committed changes.