Merge pull request #41557 from atrick/addrlower-update

Update and reimplement AddressLowering pass (for SIL opaque values).
This commit is contained in:
Andrew Trick
2022-03-21 22:15:06 -07:00
committed by GitHub
37 changed files with 4882 additions and 1864 deletions

View File

@@ -307,6 +307,12 @@ private:
/// The stage of processing this module is at.
SILStage Stage;
/// True if SIL conventions force address-only to be passed by address.
///
/// Used for bootstrapping the AddressLowering pass. This should eventually
/// be inferred from the SIL stage to be true only when Stage == Lowered.
bool loweredAddresses;
/// The set of deserialization notification handlers.
DeserializationNotificationHandlerSet deserializationNotificationHandlers;
@@ -806,6 +812,11 @@ public:
Stage = s;
}
/// True if SIL conventions force address-only to be passed by address.
bool useLoweredAddresses() const { return loweredAddresses; }
void setLoweredAddresses(bool val) { loweredAddresses = val; }
llvm::IndexedInstrProfReader *getPGOReader() const { return PGOReader.get(); }
void setPGOReader(std::unique_ptr<llvm::IndexedInstrProfReader> IPR) {
@@ -972,15 +983,13 @@ inline bool SILOptions::supportsLexicalLifetimes(const SILModule &mod) const {
// entirely.
return LexicalLifetimes != LexicalLifetimesOption::Off;
case SILStage::Canonical:
case SILStage::Lowered:
// In Canonical SIL, lexical markers are used to ensure that object
// lifetimes do not get observably shortened from the end of a lexical
// scope. That behavior only occurs when lexical lifetimes is (fully)
// enabled. (When only diagnostic markers are enabled, the markers are
// stripped as part of lowering from raw to canonical SIL.)
return LexicalLifetimes == LexicalLifetimesOption::On;
case SILStage::Lowered:
// We do not support OSSA in Lowered SIL, so this is always false.
return false;
}
}