@@ -145,8 +145,12 @@ static bool getShuffleDemandedElts(const ShuffleVectorInst *Shuf,
145
145
DemandedElts, DemandedLHS, DemandedRHS);
146
146
}
147
147
148
- void llvm::computeKnownBits (const Value *V, KnownBits &Known, unsigned Depth,
149
- const SimplifyQuery &Q) {
148
+ static void computeKnownBits (const Value *V, const APInt &DemandedElts,
149
+ KnownBits &Known, unsigned Depth,
150
+ const SimplifyQuery &Q);
151
+
152
+ static void computeKnownBits (const Value *V, KnownBits &Known, unsigned Depth,
153
+ const SimplifyQuery &Q) {
150
154
// Since the number of lanes in a scalable vector is unknown at compile time,
151
155
// we track one bit which is implicitly broadcast to all lanes. This means
152
156
// that all lanes in a scalable vector are considered demanded.
@@ -179,15 +183,15 @@ KnownBits llvm::computeKnownBits(const Value *V, const DataLayout &DL,
179
183
unsigned Depth, AssumptionCache *AC,
180
184
const Instruction *CxtI,
181
185
const DominatorTree *DT, bool UseInstrInfo) {
182
- return :: computeKnownBits (
186
+ return computeKnownBits (
183
187
V, Depth, SimplifyQuery (DL, DT, AC, safeCxtI (V, CxtI), UseInstrInfo));
184
188
}
185
189
186
190
KnownBits llvm::computeKnownBits (const Value *V, const APInt &DemandedElts,
187
191
const DataLayout &DL, unsigned Depth,
188
192
AssumptionCache *AC, const Instruction *CxtI,
189
193
const DominatorTree *DT, bool UseInstrInfo) {
190
- return :: computeKnownBits (
194
+ return computeKnownBits (
191
195
V, DemandedElts, Depth,
192
196
SimplifyQuery (DL, DT, AC, safeCxtI (V, CxtI), UseInstrInfo));
193
197
}
@@ -1780,7 +1784,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
1780
1784
KnownBits llvm::computeKnownBits (const Value *V, const APInt &DemandedElts,
1781
1785
unsigned Depth, const SimplifyQuery &Q) {
1782
1786
KnownBits Known (getBitWidth (V->getType (), Q.DL ));
1783
- computeKnownBits (V, DemandedElts, Known, Depth, Q);
1787
+ :: computeKnownBits (V, DemandedElts, Known, Depth, Q);
1784
1788
return Known;
1785
1789
}
1786
1790
@@ -1789,7 +1793,7 @@ KnownBits llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
1789
1793
KnownBits llvm::computeKnownBits (const Value *V, unsigned Depth,
1790
1794
const SimplifyQuery &Q) {
1791
1795
KnownBits Known (getBitWidth (V->getType (), Q.DL ));
1792
- computeKnownBits (V, Known, Depth, Q);
1796
+ :: computeKnownBits (V, Known, Depth, Q);
1793
1797
return Known;
1794
1798
}
1795
1799
@@ -1808,9 +1812,9 @@ KnownBits llvm::computeKnownBits(const Value *V, unsigned Depth,
1808
1812
// / where V is a vector, known zero, and known one values are the
1809
1813
// / same width as the vector element, and the bit is set only if it is true
1810
1814
// / for all of the demanded elements in the vector specified by DemandedElts.
1811
- void llvm:: computeKnownBits (const Value *V, const APInt &DemandedElts,
1812
- KnownBits &Known, unsigned Depth,
1813
- const SimplifyQuery &Q) {
1815
+ void computeKnownBits (const Value *V, const APInt &DemandedElts,
1816
+ KnownBits &Known, unsigned Depth,
1817
+ const SimplifyQuery &Q) {
1814
1818
if (!DemandedElts) {
1815
1819
// No demanded elts, better to assume we don't know anything.
1816
1820
Known.resetAll ();
0 commit comments