This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix store-fptoi combine of f128 on Power8
ClosedPublic

Authored by qiucf on Aug 27 2020, 1:16 AM.

Details

Summary

llc would crash for the below when -mcpu=pwr8:

define void @qpConv2uw_02(i32* nocapture %res) {
entry:
  %0 = load fp128, fp128* getelementptr inbounds ([4 x fp128], [4 x fp128]* @f128Array, i64 0, i64 2), align 16
  %conv = fptoui fp128 %0 to i32
  store i32 %conv, i32* %res, align 4
  ret void
}

We should not generate FP_TO_(S|U)INT_IN_VSR for f128 types at this time. This patch will fix that.

Diff Detail

Event Timeline

qiucf created this revision.Aug 27 2020, 1:16 AM
qiucf requested review of this revision.Aug 27 2020, 1:16 AM
steven.zhang added inline comments.Sep 16 2020, 3:12 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
13979

Can we check this with isTypeLegal() instead of enum all the conditions ?

qiucf updated this revision to Diff 292163.Sep 16 2020, 3:24 AM

Use isTypeLegal

steven.zhang added inline comments.Sep 16 2020, 3:35 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
14098

I think, we can remove these two lines comment now as it is not needed any more.

qiucf updated this revision to Diff 292239.Sep 16 2020, 8:56 AM

Remove comments

steven.zhang accepted this revision.Sep 16 2020, 5:00 PM

LGTM now.

This revision is now accepted and ready to land.Sep 16 2020, 5:00 PM
This revision was automatically updated to reflect the committed changes.