diff options
author | Nikita Popov <npopov@redhat.com> | 2025-10-10 15:02:17 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2025-10-10 15:08:21 +0200 |
commit | f04ae1f4b1d49c042fbbb6c811bffba5fa88a66c (patch) | |
tree | fb360e37fd6989a17bf013089efb18854237cca7 /llvm/lib | |
parent | e297184ba1b6f3683ba3e8f6197876b22c90ff7d (diff) | |
download | llvm-f04ae1f4b1d49c042fbbb6c811bffba5fa88a66c.zip llvm-f04ae1f4b1d49c042fbbb6c811bffba5fa88a66c.tar.gz llvm-f04ae1f4b1d49c042fbbb6c811bffba5fa88a66c.tar.bz2 |
[InstCombine] Perform common cast transforms for ptrtoaddr
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index 56194fe..4c9b10a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -2202,6 +2202,11 @@ Instruction *InstCombinerImpl::visitPtrToInt(PtrToIntInst &CI) { return commonCastTransforms(CI); } +Instruction *InstCombinerImpl::visitPtrToAddr(PtrToAddrInst &CI) { + // FIXME: Implement variants of ptrtoint folds. + return commonCastTransforms(CI); +} + /// This input value (which is known to have vector type) is being zero extended /// or truncated to the specified vector type. Since the zext/trunc is done /// using an integer type, we have a (bitcast(cast(bitcast))) pattern, diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index e01c145..218aaf9 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -143,6 +143,7 @@ public: Instruction *visitUIToFP(CastInst &CI); Instruction *visitSIToFP(CastInst &CI); Instruction *visitPtrToInt(PtrToIntInst &CI); + Instruction *visitPtrToAddr(PtrToAddrInst &CI); Instruction *visitIntToPtr(IntToPtrInst &CI); Instruction *visitBitCast(BitCastInst &CI); Instruction *visitAddrSpaceCast(AddrSpaceCastInst &CI); |