[PATCH] D92067: [PowerPC] Promote the i1 to i64 for SINT_TO_FP/FP_TO_SINT

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 19:17:12 PST 2020


steven.zhang created this revision.
steven.zhang added reviewers: qiucf, nemanjai, jsji, PowerPC.
Herald added subscribers: shchenz, kbarton, hiraditya.
Herald added a project: LLVM.
steven.zhang requested review of this revision.

i1 is the native type for PowerPC if crbits is enabled. However, we need to promote the i1 to i64 as we didn't have the pattern for i1. This patch fix the crash for this simple case:

  define i1 @test(double %m)  {
  entry:
    %conv = fptoui double %m to i1
    ret i1 %conv
  }

  LLVM ERROR: Cannot select: t3: i1 = fp_to_uint t2
    t2: f64,ch = CopyFromReg t0, Register:f64 %0
      t1: f64 = Register %0
  In function: test
  PLEASE submit a bug report to xl_beta at ca.ibm.com and include the crash backtrace.
  Stack dump:


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92067

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/test/CodeGen/PowerPC/f128-conv.ll
  llvm/test/CodeGen/PowerPC/fp-strict-conv-f128.ll
  llvm/test/CodeGen/PowerPC/fp-to-int-to-fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92067.307497.patch
Type: text/x-patch
Size: 21992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201125/1011b056/attachment.bin>


More information about the llvm-commits mailing list