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:
7b86bc2
)
[Analysis] add comment to generalize finding a scalar op from vector; NFC
author
Sanjay Patel
<spatel@rotateright.com>
Mon, 24 Sep 2018 17:18:32 +0000
(17:18 +0000)
committer
Sanjay Patel
<spatel@rotateright.com>
Mon, 24 Sep 2018 17:18:32 +0000
(17:18 +0000)
llvm-svn: 342906
llvm/lib/Analysis/VectorUtils.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Analysis/VectorUtils.cpp
b/llvm/lib/Analysis/VectorUtils.cpp
index
2f4f72a
..
c639f36
100644
(file)
--- a/
llvm/lib/Analysis/VectorUtils.cpp
+++ b/
llvm/lib/Analysis/VectorUtils.cpp
@@
-280,9
+280,10
@@
Value *llvm::findScalarElement(Value *V, unsigned EltNo) {
}
// Extract a value from a vector add operation with a constant zero.
- Value *Val = nullptr; Constant *Con = nullptr;
- if (match(V, m_Add(m_Value(Val), m_Constant(Con))))
- if (Constant *Elt = Con->getAggregateElement(EltNo))
+ // TODO: Use getBinOpIdentity() to generalize this.
+ Value *Val; Constant *C;
+ if (match(V, m_Add(m_Value(Val), m_Constant(C))))
+ if (Constant *Elt = C->getAggregateElement(EltNo))
if (Elt->isNullValue())
return findScalarElement(Val, EltNo);