[PATCH] D107880: [AArch64][SVE] Remove assertion/range check for i16 values during immediate selection
Usman Nadeem via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 10 23:11:55 PDT 2021
mnadeem created this revision.
Herald added subscribers: psnobl, hiraditya, kristof.beyls, tschuett.
Herald added a reviewer: efriedma.
mnadeem requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This assertion fails when an i16 constant is promoted to i32.
Example: https://godbolt.org/z/rxo649jEo
The value `i16 -32768` is within the range of i16 but is promoted to
positive `i32 32768` by an earlier call to `DAG.getConstant()`.
Another option would be to modify the assert to:
assert((ImmVal >= -32768) && (ImmVal <= 65535));
not sure if this is any better.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107880
Files:
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
Index: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -3152,7 +3152,6 @@
Imm = CurDAG->getTargetConstant(ImmVal, DL, MVT::i32);
return true;
} else if ((ImmVal & 0xFF) == 0) {
- assert((ImmVal >= -32768) && (ImmVal <= 32512));
Shift = CurDAG->getTargetConstant(8, DL, MVT::i32);
Imm = CurDAG->getTargetConstant((ImmVal >> 8) & 0xFF, DL, MVT::i32);
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107880.365658.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210811/969ea9c3/attachment.bin>
More information about the llvm-commits
mailing list