diff options
author | Xinliang David Li <davidxl@google.com> | 2017-10-10 05:07:54 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2017-10-10 05:07:54 +0000 |
commit | 4cdc9dab0ac938ff1045dc3eddfe8ee23f1279d7 (patch) | |
tree | 694c10a36a22faa60a01a2ac4e395485eaf97672 /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | c04a91aa39b302d37cc01d222adcaefc770e78bf (diff) | |
download | bcm5719-llvm-4cdc9dab0ac938ff1045dc3eddfe8ee23f1279d7.tar.gz bcm5719-llvm-4cdc9dab0ac938ff1045dc3eddfe8ee23f1279d7.zip |
Renable r314928
Eliminate inttype phi with inttoptr/ptrtoint.
This version fixed a bug in finding the matching
phi -- the order of the incoming blocks may be
different (triggered in self build on Windows).
A new test case is added.
llvm-svn: 315272
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 46f86114718..f1404facaf3 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -670,6 +670,10 @@ private: Instruction *FoldPHIArgGEPIntoPHI(PHINode &PN); Instruction *FoldPHIArgLoadIntoPHI(PHINode &PN); Instruction *FoldPHIArgZextsIntoPHI(PHINode &PN); + /// If an integer typed PHI has only one use which is an IntToPtr operation, + /// replace the PHI with an existing pointer typed PHI if it exists. Otherwise + /// insert a new pointer typed PHI and replace the original one. + Instruction *FoldIntegerTypedPHI(PHINode &PN); /// Helper function for FoldPHIArgXIntoPHI() to set debug location for the /// folded operation. |