projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b37a4e
)
[LICM] Add assert of AST/MSSA exclusiveness.
author
Alina Sbirlea
<asbirlea@google.com>
Tue, 3 Nov 2020 01:50:53 +0000
(17:50 -0800)
committer
Alina Sbirlea
<asbirlea@google.com>
Tue, 3 Nov 2020 02:04:43 +0000
(18:04 -0800)
The API `canSinkOrHoistInst` may be called by LoopSink. Add assert to
avoid having two analyses passed in.
llvm/lib/Transforms/Scalar/LICM.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Scalar/LICM.cpp
b/llvm/lib/Transforms/Scalar/LICM.cpp
index
b635440
..
3c9aa94
100644
(file)
--- a/
llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/
llvm/lib/Transforms/Scalar/LICM.cpp
@@
-1106,6
+1106,9
@@
bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
bool TargetExecutesOncePerLoop,
SinkAndHoistLICMFlags *Flags,
OptimizationRemarkEmitter *ORE) {
+ assert(((CurAST != nullptr) ^ (MSSAU != nullptr)) &&
+ "Either AliasSetTracker or MemorySSA should be initialized.");
+
// If we don't understand the instruction, bail early.
if (!isHoistableAndSinkableInst(I))
return false;