Page MenuHomePhabricator

[PowerPC] Skip combining (uint_to_fp x) if x is not simple type
ClosedPublic

Authored by lkail on Sep 27 2020, 7:41 PM.

Details

Summary

Current powerpc64le backend hits

Combining: t7: f64 = uint_to_fp t6
llc: llvm-project/llvm/include/llvm/CodeGen/ValueTypes.h:291: llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && "Expected a SimpleValueType!"' failed.

This patch fixes it by skipping combination if t6 is not simple type.
Fixed https://bugs.llvm.org/show_bug.cgi?id=47660.

Diff Detail

Event Timeline

lkail created this revision.Sep 27 2020, 7:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2020, 7:41 PM
lkail requested review of this revision.Sep 27 2020, 7:41 PM
steven.zhang accepted this revision.Oct 10 2020, 1:40 AM

LGTM with minor nit.

llvm/test/CodeGen/PowerPC/pr47660.ll
38

The test can be further reduced to

entry:
   %conv1 = uitofp i24 %g.coerce to double
   %mul = fmul double 0.000000e+00, %conv1
   %conv2 = fptoui double %mul to i8
   ret i8 %conv2
This revision is now accepted and ready to land.Oct 10 2020, 1:40 AM