Skip to content

Commit d59a330

Browse files
author
git apple-llvm automerger
committed
Merge commit 'cf1a27cd802d' from swift/release/5.4 into swift/main
2 parents 6604b61 + cf1a27c commit d59a330

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ X86DAGToDAGISel::IsProfitableToFold(SDValue N, SDNode *U, SDNode *Root) const {
611611
// best of both worlds.
612612
if (U->getOpcode() == ISD::AND &&
613613
Imm->getAPIntValue().getBitWidth() == 64 &&
614-
Imm->getAPIntValue().isIntN(32))
614+
Imm->getAPIntValue().isSignedIntN(32))
615615
return false;
616616

617617
// If this really a zext_inreg that can be represented with a movzx

llvm/test/CodeGen/X86/pr48458.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
3+
4+
define i1 @foo(i64* %0) {
5+
; CHECK-LABEL: foo:
6+
; CHECK: # %bb.0: # %top
7+
; CHECK-NEXT: movq (%rdi), %rax
8+
; CHECK-NEXT: andq $-2147483648, %rax # imm = 0x80000000
9+
; CHECK-NEXT: sete %al
10+
; CHECK-NEXT: retq
11+
top:
12+
%1 = load i64, i64* %0, !range !0
13+
%2 = icmp ult i64 %1, 2147483648
14+
ret i1 %2
15+
}
16+
17+
!0 = !{i64 0, i64 10000000000}

0 commit comments

Comments
 (0)