Skip to content

Commit 5f77a9a

Browse files
author
git apple-llvm automerger
committed
Merge commit '801b1dc9cc17' from llvm.org/main into next
2 parents 9808a29 + 801b1dc commit 5f77a9a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ uint32_t GVNPass::ValueTable::lookupOrAdd(Value *V) {
531531
case Instruction::FPTrunc:
532532
case Instruction::FPExt:
533533
case Instruction::PtrToInt:
534+
case Instruction::PtrToAddr:
534535
case Instruction::IntToPtr:
535536
case Instruction::AddrSpaceCast:
536537
case Instruction::BitCast:

llvm/test/Transforms/GVN/ptrtoaddr.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
define i64 @ptrtoaddr_same(ptr %p) {
55
; CHECK-LABEL: define i64 @ptrtoaddr_same(
66
; CHECK-SAME: ptr [[P:%.*]]) {
7-
; CHECK-NEXT: [[I:%.*]] = ptrtoaddr ptr [[P]] to i64
87
; CHECK-NEXT: [[J:%.*]] = ptrtoaddr ptr [[P]] to i64
9-
; CHECK-NEXT: [[SUB:%.*]] = sub i64 [[I]], [[J]]
10-
; CHECK-NEXT: ret i64 [[SUB]]
8+
; CHECK-NEXT: ret i64 0
119
;
1210
%i = ptrtoaddr ptr %p to i64
1311
%j = ptrtoaddr ptr %p to i64

0 commit comments

Comments
 (0)