[PPCGCodeGeneration] Check that invariant load hoisting succeeded.

If we fail, throw an error for now. We can gracefully handle this later.

llvm-svn: 309387
This commit is contained in:
Siddharth Bhat
2017-07-28 14:48:32 +00:00
parent 45b4014711
commit 4ebeb3568a

View File

@@ -3197,7 +3197,10 @@ public:
// preload invariant loads. Note: This should happen before the RTC
// because the RTC may depend on values that are invariant load hoisted.
NodeBuilder.preloadInvariantLoads();
if (!NodeBuilder.preloadInvariantLoads())
report_fatal_error("preloading invariant loads failed in function: " +
S->getFunction().getName() +
" | Scop Region: " + S->getNameStr());
Value *RTC = NodeBuilder.createRTC(Condition);
Builder.GetInsertBlock()->getTerminator()->setOperand(0, RTC);