@@ -2562,23 +2562,24 @@ bool SelectionDAG::expandMultipleResultFPLibCall(
2562
2562
auto *ST = cast<StoreSDNode>(User);
2563
2563
SDValue StoreValue = ST->getValue();
2564
2564
unsigned ResNo = StoreValue.getResNo();
2565
+ // Ensure the store corresponds to an output pointer.
2566
+ if (CallRetResNo == ResNo)
2567
+ continue;
2568
+ // Ensure the store to the default address space and not atomic or volatile.
2569
+ if (!ST->isSimple() || ST->getAddressSpace() != 0)
2570
+ continue;
2571
+ // Ensure all store chains are the same (so they don't alias).
2572
+ if (StoresInChain && ST->getChain() != StoresInChain)
2573
+ continue;
2574
+ // Ensure the store is properly aligned.
2565
2575
Type *StoreType = StoreValue.getValueType().getTypeForEVT(Ctx);
2566
- if (
2567
- // Ensure the store corresponds to an output pointer.
2568
- CallRetResNo == ResNo ||
2569
- // Ensure the store is not atomic or volatile.
2570
- !ST->isSimple() ||
2571
- // Ensure the store is in the default address space.
2572
- ST->getAddressSpace() != 0 ||
2573
- // Ensure the store is properly aligned.
2574
- ST->getAlign() <
2575
- getDataLayout().getABITypeAlign(StoreType->getScalarType()) ||
2576
- // Ensure all store chains are the same (so they don't alias).
2577
- (StoresInChain && ST->getChain() != StoresInChain) ||
2578
- // Avoid:
2579
- // 1. Creating cyclic dependencies.
2580
- // 2. Expanding the node to a call within a call sequence.
2581
- !canFoldStoreIntoLibCallOutputPointers(ST, Node))
2576
+ if (ST->getAlign() <
2577
+ getDataLayout().getABITypeAlign(StoreType->getScalarType()))
2578
+ continue;
2579
+ // Avoid:
2580
+ // 1. Creating cyclic dependencies.
2581
+ // 2. Expanding the node to a call within a call sequence.
2582
+ if (!canFoldStoreIntoLibCallOutputPointers(ST, Node))
2582
2583
continue;
2583
2584
ResultStores[ResNo] = ST;
2584
2585
StoresInChain = ST->getChain();
0 commit comments