1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/lib/Transforms/InstCombine
Krishna Kariya 05b090ffb1 [InstCombine] Fold IntToPtr/PtrToInt to bitcast
The inttoptr/ptrtoint roundtrip optimization is not always correct.
We are working towards removing this optimization and adding support
to specific cases where this optimization works. This patch is the
first one on this line.

Consider the example:

    %i = ptrtoint i8* %X to i64
    %p = inttoptr i64 %i to i16*
    %cmp = icmp eq i8* %load, %p

In this specific case, the inttoptr/ptrtoint optimization is correct
as it only compares the pointer values. In this patch, we fold
inttoptr/ptrtoint to a bitcast (if src and dest types are different).

Differential Revision: https://reviews.llvm.org/D105088
2021-07-18 23:13:25 +02:00
..
CMakeLists.txt
InstCombineAddSub.cpp [InstCombine] fold reassociative FP add into start value of fadd reduction 2021-07-18 06:26:20 -04:00
InstCombineAndOrXor.cpp [InstCombine] InstCombinerImpl::visitOr - enable bitreverse matching 2021-05-15 13:39:09 +01:00
InstCombineAtomicRMW.cpp
InstCombineCalls.cpp [InstCombine][NFC]Use only replaceInstUsesWith, NFC. 2021-07-08 13:58:30 -07:00
InstCombineCasts.cpp [InstCombine] Eliminate casts to optimize ctlz operation 2021-06-23 11:19:12 -04:00
InstCombineCompares.cpp [InstCombine] Fold IntToPtr/PtrToInt to bitcast 2021-07-18 23:13:25 +02:00
InstCombineInternal.h [InstCombine] Fold IntToPtr/PtrToInt to bitcast 2021-07-18 23:13:25 +02:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Gracefully handle an alloca outside the alloca-AS 2021-06-29 09:38:13 -05:00
InstCombineMulDivRem.cpp [InstCombine] Fold (sext bool X) * (sext bool X) to zext (and X, X) 2021-06-18 16:28:06 +07:00
InstCombineNegator.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
InstCombinePHI.cpp [InstCombine] Don't combine PHI before catchswitch 2021-07-02 12:10:24 -07:00
InstCombineSelect.cpp [InstCombine] Strip inbounds from (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) fold 2021-07-15 12:19:10 +01:00
InstCombineShifts.cpp [InstCombine] Fold lshr/ashr(or(neg(x),x),bw-1) --> zext/sext(icmp_ne(x,0)) (PR50816) 2021-07-13 14:44:54 +01:00
InstCombineSimplifyDemanded.cpp [InsCombine] Fix a few remaining vec transforms to use poison instead of undef 2021-05-31 18:47:09 +09:00
InstCombineVectorOps.cpp [NFC] Fix a few whitespace issues and typos. 2021-07-04 11:49:58 +01:00
InstructionCombining.cpp [InstCombine] Fold IntToPtr/PtrToInt to bitcast 2021-07-18 23:13:25 +02:00