[PATCH] D28501: Add an assert for hasLoopInvariantOperands
Xin Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 9 16:50:24 PST 2017
trentxintong updated this revision to Diff 83744.
trentxintong added a comment.
Address comments.
https://reviews.llvm.org/D28501
Files:
lib/Transforms/Scalar/LoopSink.cpp
Index: lib/Transforms/Scalar/LoopSink.cpp
===================================================================
--- lib/Transforms/Scalar/LoopSink.cpp
+++ lib/Transforms/Scalar/LoopSink.cpp
@@ -283,6 +283,9 @@
// sinked.
for (auto II = Preheader->rbegin(), E = Preheader->rend(); II != E;) {
Instruction *I = &*II++;
+ // No need to check for instruction's operands are loop invariant.
+ assert(L.hasLoopInvariantOperands(I) &&
+ "Insts in a loop's preheader should have loop invariant operands!");
if (!canSinkOrHoistInst(*I, &AA, &DT, &L, &CurAST, nullptr))
continue;
if (sinkInstruction(L, *I, ColdLoopBBs, LoopBlockNumber, LI, DT, BFI))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28501.83744.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/fcbb298c/attachment.bin>
More information about the llvm-commits
mailing list