diff options
| author | mingmingl <mingmingl@google.com> | 2025-02-04 11:11:14 -0800 |
|---|---|---|
| committer | mingmingl <mingmingl@google.com> | 2025-02-04 11:11:14 -0800 |
| commit | e91747a92d27ecf799427bf563f9f64f7c4d2447 (patch) | |
| tree | 7aa5a8a9170deec293e152bdf2be804399dcd612 /llvm/lib/Transforms/IPO | |
| parent | 3a8d9337d816aef41c3ca1484be8b933a71a3c46 (diff) | |
| parent | 53d6e59b594639417cdbfcfa2d18cea64acb4009 (diff) | |
Merge branch 'main' into users/mingmingl-llvm/spr/sdpglobalvariableusers/mingmingl-llvm/spr/sdpglobalvariable
Diffstat (limited to 'llvm/lib/Transforms/IPO')
| -rw-r--r-- | llvm/lib/Transforms/IPO/IROutliner.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp index 41bc67f2b689..34ddeeb37400 100644 --- a/llvm/lib/Transforms/IPO/IROutliner.cpp +++ b/llvm/lib/Transforms/IPO/IROutliner.cpp @@ -1184,22 +1184,22 @@ static std::optional<unsigned> getGVNForPHINode(OutlinableRegion &Region, for (unsigned Idx = 0, EIdx = PN->getNumIncomingValues(); Idx < EIdx; Idx++) { Incoming = PN->getIncomingValue(Idx); IncomingBlock = PN->getIncomingBlock(Idx); + // If the incoming block isn't in the region, we don't have to worry about + // this incoming value. + if (!Blocks.contains(IncomingBlock)) + continue; + // If we cannot find a GVN, and the incoming block is included in the region // this means that the input to the PHINode is not included in the region we // are trying to analyze, meaning, that if it was outlined, we would be // adding an extra input. We ignore this case for now, and so ignore the // region. std::optional<unsigned> OGVN = Cand.getGVN(Incoming); - if (!OGVN && Blocks.contains(IncomingBlock)) { + if (!OGVN) { Region.IgnoreRegion = true; return std::nullopt; } - // If the incoming block isn't in the region, we don't have to worry about - // this incoming value. - if (!Blocks.contains(IncomingBlock)) - continue; - // Collect the canonical numbers of the values in the PHINode. unsigned GVN = *OGVN; OGVN = Cand.getCanonicalNum(GVN); |
