We're using CMPNE(X, 0) to truncate promoted fixed width masks to scalable masks. My confidence is moderate on this, but I think the preceding AND(X, 0x1) is unnecessary. I wouldn't expect a false element with tops bits set.
Did I miss something??
Paths
| Differential D85460
[SVE] No need to AND(X, 0x1) when truncating a scalable mask AbandonedPublic Authored by cameron.mcinally on Aug 6 2020, 11:40 AM.
Details
Summary We're using CMPNE(X, 0) to truncate promoted fixed width masks to scalable masks. My confidence is moderate on this, but I think the preceding AND(X, 0x1) is unnecessary. I wouldn't expect a false element with tops bits set. Did I miss something??
Diff Detail
Unit TestsFailed Event TimelineComment Actions The semantics of TRUNCATE is that it throws away the high bits. For most types, this happens implicitly, but we have to be a little more explicit here. We can't assume a the operand to a random TRUNCATE to i1 is produced by a compare operation. If it turns out the operand to the AND is actually an all-ones/all-zeros value, we can optimize out the AND, sure.
Revision Contents
Diff 283683 llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-trunc.ll
|