|
@@ -283,6 +283,9 @@ static bool isSafeAndProfitableToSinkLoad(LoadInst *L) {
|
|
}
|
|
}
|
|
|
|
|
|
Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) {
|
|
Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) {
|
|
|
|
+ // HLSL Change Begin - Do not create phi on pointer.
|
|
|
|
+ return nullptr;
|
|
|
|
+ // HLSL Change End.
|
|
LoadInst *FirstLI = cast<LoadInst>(PN.getIncomingValue(0));
|
|
LoadInst *FirstLI = cast<LoadInst>(PN.getIncomingValue(0));
|
|
|
|
|
|
// FIXME: This is overconservative; this transform is allowed in some cases
|
|
// FIXME: This is overconservative; this transform is allowed in some cases
|
|
@@ -298,11 +301,6 @@ Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) {
|
|
bool isVolatile = FirstLI->isVolatile();
|
|
bool isVolatile = FirstLI->isVolatile();
|
|
unsigned LoadAlignment = FirstLI->getAlignment();
|
|
unsigned LoadAlignment = FirstLI->getAlignment();
|
|
unsigned LoadAddrSpace = FirstLI->getPointerAddressSpace();
|
|
unsigned LoadAddrSpace = FirstLI->getPointerAddressSpace();
|
|
- // HLSL Change Begin.
|
|
|
|
- // Do not create phi on non-default address space.
|
|
|
|
- if (LoadAddrSpace != 0)
|
|
|
|
- return nullptr;
|
|
|
|
- // HLSL Change End.
|
|
|
|
|
|
|
|
// We can't sink the load if the loaded value could be modified between the
|
|
// We can't sink the load if the loaded value could be modified between the
|
|
// load and the PHI.
|
|
// load and the PHI.
|