This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Handle STRICT_FSETCC(S) in more cases
ClosedPublic

Authored by qiucf on Aug 26 2020, 1:12 AM.

Details

Summary

On -O0, i1 strict_fsetcc will be promoted to i32. We can't handle that in TD patterns. This patch fills logic in PPCISelDAGToDAG to handle more cases.

Diff Detail

Event Timeline

qiucf created this revision.Aug 26 2020, 1:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2020, 1:12 AM
qiucf requested review of this revision.Aug 26 2020, 1:12 AM
uweigand requested changes to this revision.Aug 26 2020, 8:48 AM
uweigand added inline comments.
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
4176

This is wrong for strict mode. You'll need to create a strict version of SELECT_CC here, and this needs to handle the (incoming and outgoing) chain.

4199

This doesn't make sense - the RLWINM instruction does not actually have two outputs. Again, the outgoing chain needs to be processed by the strict SELECT_CC above. The RLWINM (as a pure integer operation) only creates the integer output. It can be merged back with the chain from above using e.g. MERGE_VALUES here.

4210

Same comment as above.

This revision now requires changes to proceed.Aug 26 2020, 8:48 AM
qiucf added inline comments.Aug 26 2020, 9:01 AM
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
4176

I think here the method name is a little bit confusing.. It doesn't create SELECT_CC, instead, it selects the fcmp* opcode by operand type and predicate, and return a machine node of that.

But yes, the chain needs to be handled here since it's the core FP operation we want.

qiucf updated this revision to Diff 289080.Aug 31 2020, 11:25 PM
qiucf marked an inline comment as done.

Fix chain of fcmp instruction

uweigand accepted this revision.Sep 1 2020, 12:46 AM

This LGTM now, thanks!

This revision is now accepted and ready to land.Sep 1 2020, 12:46 AM
This revision was automatically updated to reflect the committed changes.