[PATCH] [PowerPC] PPCBoolRetToInt: Don't translate Constant's operands
authorKai Luo <lkail@cn.ibm.com>
Fri, 28 Aug 2020 01:56:12 +0000 (01:56 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sat, 31 Oct 2020 13:13:25 +0000 (13:13 +0000)
commit6e61e570579ec58cf704e88d41b0d70da41fbfd7
tree9134c7539b8d079c002f215b1a3ba1450febe633
parent23649b005f509cc57ca61ada515a9ed15f82a7b1
[PATCH] [PowerPC] PPCBoolRetToInt: Don't translate Constant's operands

When collecting `i1` values via `findAllDefs`, ignore Constant's
operands, since Constant's operands might not be `i1`.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46923 which causes ICE
```
llvm-project/llvm/lib/IR/Constants.cpp:1924: static llvm::Constant *llvm::ConstantExpr::getZExt(llvm::Constant *, llvm::Type *, bool): Assertion `C->getType()->getScalarSizeInBits() < Ty->getScalarSizeInBits()&& "SrcTy must be smaller than DestTy for ZExt!"' failed.
```

Differential Revision: https://reviews.llvm.org/D85007

Gbp-Pq: Name PowerPC-PPCBoolRetToInt-Dont-translate-Constants-operands.diff
llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp
llvm/test/CodeGen/PowerPC/pr46923.ll [new file with mode: 0644]