Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13715,11 +13715,10 @@ static SDValue EmitVectorComparison(SDValue LHS, SDValue RHS,
bool IsCnst = BVN && BVN->isConstantSplat(SplatValue, SplatUndef,
SplatBitSize, HasAnyUndefs);

bool IsSplatUniform =
SrcVT.getVectorElementType().getSizeInBits() >= SplatBitSize;
bool IsZero = IsCnst && SplatValue == 0 && IsSplatUniform;
bool IsOne = IsCnst && SplatValue == 1 && IsSplatUniform;
bool IsMinusOne = IsCnst && SplatValue.isAllOnes() && IsSplatUniform;
bool IsZero = IsCnst && SplatValue == 0;
bool IsOne =
IsCnst && SrcVT.getScalarSizeInBits() == SplatBitSize && SplatValue == 1;
bool IsMinusOne = IsCnst && SplatValue.isAllOnes();

if (SrcVT.getVectorElementType().isFloatingPoint()) {
switch (CC) {
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/CodeGen/AArch64/neon-compare-instructions.ll
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,8 @@ define <8 x i1> @not_cmle8xi8(<8 x i8> %0) {
define <4 x i1> @not_cmle16xi8(<4 x i32> %0) {
; CHECK-SD-LABEL: not_cmle16xi8:
; CHECK-SD: // %bb.0: // %entry
; CHECK-SD-NEXT: cmle v0.4s, v0.4s, #0
; CHECK-SD-NEXT: movi v1.8h, #1
; CHECK-SD-NEXT: cmgt v0.4s, v1.4s, v0.4s
; CHECK-SD-NEXT: xtn v0.4h, v0.4s
; CHECK-SD-NEXT: ret
;
Expand Down