[LVI] Improve LazyValueInfo compile time performance
[oota-llvm.git] / lib / CodeGen / MachineFunction.cpp
index 5a797f848436faabb9a050d43bf0c3888c93abe7..cf9213b84c41abfb2b29e33cc3c589a4b4ed50a4 100644 (file)
@@ -87,6 +87,11 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
 
   FunctionNumber = FunctionNum;
   JumpTableInfo = nullptr;
+
+  assert(TM.isCompatibleDataLayout(getDataLayout()) &&
+         "Can't create a MachineFunction using a Module with a "
+         "Target-incompatible DataLayout attached\n");
+
   PSVManager = llvm::make_unique<PseudoSourceValueManager>();
 }