[PATCH] D157513: [X86] Fix aliasing check between a TargetFrameIndex and a FrameIndex

Nabeel Omer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 08:00:40 PDT 2023


n-omer updated this revision to Diff 549047.
n-omer added a comment.

Rebase.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157513/new/

https://reviews.llvm.org/D157513

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
  llvm/test/CodeGen/X86/pr63645.ll


Index: llvm/test/CodeGen/X86/pr63645.ll
===================================================================
--- llvm/test/CodeGen/X86/pr63645.ll
+++ 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
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157513.549047.patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230810/d504dac4/attachment.bin>


More information about the llvm-commits mailing list