OSDN Git Service

[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)
committerKai Luo <lkail@cn.ibm.com>
Fri, 28 Aug 2020 01:56:12 +0000 (01:56 +0000)
commitcbea17568f4301582c1d5d43990f089ca6cff522
tree46afd88bcaff39d97c9dd37b896f7288e86e7a08
parentd370836c20c58c9092efbd1b2ee9002ab500af55
[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
llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp
llvm/test/CodeGen/PowerPC/pr46923.ll [new file with mode: 0644]