diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-05 18:53:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-05 18:53:28 +0000 |
commit | f6befffbb26fe789173cf4b981498a63be65d8d9 (patch) | |
tree | 36026d1ca5fe1489e960a0aab972b3d855bbe5fc /llvm/lib/Transforms | |
parent | 3c36a6669af688a621f741a5504ea143feff8342 (diff) | |
download | bcm5719-llvm-f6befffbb26fe789173cf4b981498a63be65d8d9.tar.gz bcm5719-llvm-f6befffbb26fe789173cf4b981498a63be65d8d9.zip |
fix PR6512, a case where instcombine would incorrectly merge loads
from different addr spaces.
llvm-svn: 97813
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp index fba83542cdb..65f03936870 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -266,6 +266,7 @@ Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) { // and if TD isn't around, we can't handle the mixed case. bool isVolatile = FirstLI->isVolatile(); unsigned LoadAlignment = FirstLI->getAlignment(); + unsigned LoadAddrSpace = FirstLI->getPointerAddressSpace(); // We can't sink the load if the loaded value could be modified between the // load and the PHI. @@ -290,6 +291,7 @@ Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) { // the load and the PHI. if (LI->isVolatile() != isVolatile || LI->getParent() != PN.getIncomingBlock(i) || + LI->getPointerAddressSpace() != LoadAddrSpace || !isSafeAndProfitableToSinkLoad(LI)) return 0; |