This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] add operation legality checks before creating shift ops (PR43542)
ClosedPublic

Authored by spatel on Oct 3 2019, 8:17 AM.

Details

Summary

As discussed on llvm-dev and:
https://bugs.llvm.org/show_bug.cgi?id=43542
...we have transforms that assume shift operations are legal and transforms to use them are profitable, but that may not hold for simple targets.
In this case, the MSP430 target custom lowers shifts by repeating (many) simpler/fixed ops. That can be avoided by keeping this code as setcc/select.

Diff Detail

Event Timeline

spatel created this revision.Oct 3 2019, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2019, 8:17 AM

I've always wondered why in DAGCombine we create nodes rarely consulting with TLI.isOperation*().
This patch explains it :/ Looks ok to me..

fhahn added a subscriber: fhahn.Oct 3 2019, 1:33 PM
joanlluch accepted this revision.Oct 3 2019, 2:14 PM

It works for me.

This revision is now accepted and ready to land.Oct 3 2019, 2:14 PM
This revision was automatically updated to reflect the committed changes.