Skip to content

Commit bcec41e

Browse files
committed
[NewGVN] Add support for ptrtoaddr
1 parent 55c7c4e commit bcec41e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/Transforms/Scalar/NewGVN.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,7 @@ NewGVN::performSymbolicEvaluation(Instruction *I,
20662066
case Instruction::FPTrunc:
20672067
case Instruction::FPExt:
20682068
case Instruction::PtrToInt:
2069+
case Instruction::PtrToAddr:
20692070
case Instruction::IntToPtr:
20702071
case Instruction::Select:
20712072
case Instruction::ExtractElement:

llvm/test/Transforms/NewGVN/ptrtoaddr.ll

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

0 commit comments

Comments
 (0)