[PATCH] D56307: GlobalISel: Remove invalid assert
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 3 22:41:54 PST 2019
arsenm created this revision.
arsenm added reviewers: ab, aditya_nandakumar, qcolombet, t.p.northover.
Herald added subscribers: kristof.beyls, rovka, wdng.
G_CONSTANT is allowed for vectors
https://reviews.llvm.org/D56307
Files:
lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
Index: lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
===================================================================
--- lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -242,10 +242,8 @@
const ConstantInt &Val) {
LLT Ty = Res.getLLTTy(*getMRI());
- assert((Ty.isScalar() || Ty.isPointer()) && "invalid operand type");
-
const ConstantInt *NewVal = &Val;
- if (Ty.getSizeInBits() != Val.getBitWidth())
+ if (Ty.getScalarSizeInBits() != Val.getBitWidth())
NewVal = ConstantInt::get(getMF().getFunction().getContext(),
Val.getValue().sextOrTrunc(Ty.getSizeInBits()));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56307.180198.patch
Type: text/x-patch
Size: 716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190104/38c98194/attachment.bin>
More information about the llvm-commits
mailing list