[NewGVN] Add support for ptrtoaddr

This commit is contained in:
Nikita Popov
2025-10-08 16:16:32 +02:00
parent 55c7c4e623
commit bcec41e5e6
2 changed files with 2 additions and 4 deletions

View File

@@ -2066,6 +2066,7 @@ NewGVN::performSymbolicEvaluation(Instruction *I,
case Instruction::FPTrunc:
case Instruction::FPExt:
case Instruction::PtrToInt:
case Instruction::PtrToAddr:
case Instruction::IntToPtr:
case Instruction::Select:
case Instruction::ExtractElement:

View File

@@ -4,10 +4,7 @@
define i64 @ptrtoaddr_same(ptr %p) {
; CHECK-LABEL: define i64 @ptrtoaddr_same(
; CHECK-SAME: ptr [[P:%.*]]) {
; CHECK-NEXT: [[J:%.*]] = ptrtoaddr ptr [[P]] to i64
; CHECK-NEXT: [[J1:%.*]] = ptrtoaddr ptr [[P]] to i64
; CHECK-NEXT: [[SUB:%.*]] = sub i64 [[J]], [[J1]]
; CHECK-NEXT: ret i64 [[SUB]]
; CHECK-NEXT: ret i64 0
;
%i = ptrtoaddr ptr %p to i64
%j = ptrtoaddr ptr %p to i64