[PATCH] D45315: [X86] Improve unsigned saturation downconvert detection.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 15 03:04:18 PDT 2018
RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.
LGTM with one minor fix in the assertion
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:34623
// Saturation with truncation. We truncate from InVT to VT.
- assert(In.getScalarValueSizeInBits() > VT.getScalarSizeInBits() &&
- "Unexpected types for truncate operation");
+ assert(InVT.bitsGT(VT) && "Unexpected types for truncate operation");
----------------
You should be asserting on scalar bits sizes:
```
assert(InVT.getScalarSizeInBits() > VT.getScalarSizeInBits() &&
"Unexpected types for truncate operation");
```
Repository:
rL LLVM
https://reviews.llvm.org/D45315
More information about the llvm-commits
mailing list