diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp @@ -130,7 +130,7 @@ MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo(); // If the base are the same frame index but the we couldn't find a // constant offset, (indices are different) be conservative. - if (A != B && (!MFI.isFixedObjectIndex(A->getIndex()) || + if (A->getIndex() != B->getIndex() && (!MFI.isFixedObjectIndex(A->getIndex()) || !MFI.isFixedObjectIndex(B->getIndex()))) { IsAlias = false; return true; diff --git a/llvm/test/CodeGen/X86/pr63645.ll b/llvm/test/CodeGen/X86/pr63645.ll --- a/llvm/test/CodeGen/X86/pr63645.ll +++ b/llvm/test/CodeGen/X86/pr63645.ll @@ -17,6 +17,8 @@ ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movl $0, c(%rip) ; CHECK-NEXT: movq $64, p(%rip) +; CHECK-NEXT: movabsq $214787019555673, %rax # imm = 0xC3590000C359 +; CHECK-NEXT: movq %rax, -{{[0-9]+}}(%rsp) ; CHECK-NEXT: cmpl $42828, -{{[0-9]+}}(%rsp) # imm = 0xA74C ; CHECK-NEXT: jg .LBB0_2 ; CHECK-NEXT: # %bb.1: # %if.then.1.i