LLVM 24.0.0git
PHITransAddr.cpp
Go to the documentation of this file.
1//===- PHITransAddr.cpp - PHI Translation for Addresses -------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the PHITransAddr class.
10//
11//===----------------------------------------------------------------------===//
12
16#include "llvm/Config/llvm-config.h"
17#include "llvm/IR/Constants.h"
18#include "llvm/IR/Dominators.h"
23using namespace llvm;
24
26 "gvn-add-phi-translation", cl::init(false), cl::Hidden,
27 cl::desc("Enable phi-translation of add instructions"));
28
29static bool canPHITrans(Instruction *Inst) {
30 if (isa<PHINode>(Inst) || isa<GetElementPtrInst>(Inst) || isa<CastInst>(Inst))
31 return true;
32
33 if (Inst->getOpcode() == Instruction::Add &&
35 return true;
36
37 return false;
38}
39
40#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
42 if (!Addr) {
43 dbgs() << "PHITransAddr: null\n";
44 return;
45 }
46 dbgs() << "PHITransAddr: " << *Addr << "\n";
47 for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
48 dbgs() << " Input #" << i << " is " << *InstInputs[i] << "\n";
49}
50#endif
51
52static bool verifySubExpr(Value *Expr,
54 // If this is a non-instruction value, there is nothing to do.
56 if (!I) return true;
57
58 // If it's an instruction, it is either in Tmp or its operands recursively
59 // are.
60 if (auto Entry = find(InstInputs, I); Entry != InstInputs.end()) {
61 InstInputs.erase(Entry);
62 return true;
63 }
64
65 // If it isn't in the InstInputs list it is a subexpr incorporated into the
66 // address. Validate that it is phi translatable.
67 if (!canPHITrans(I)) {
68 errs() << "Instruction in PHITransAddr is not phi-translatable:\n";
69 errs() << *I << '\n';
70 llvm_unreachable("Either something is missing from InstInputs or "
71 "canPHITrans is wrong.");
72 }
73
74 // Validate the operands of the instruction.
75 return all_of(I->operands(),
76 [&](Value *Op) { return verifySubExpr(Op, InstInputs); });
77}
78
79/// verify - Check internal consistency of this data structure. If the
80/// structure is valid, it returns true. If invalid, it prints errors and
81/// returns false.
83 if (!Addr) return true;
84
85 SmallVector<Instruction*, 8> Tmp(InstInputs.begin(), InstInputs.end());
86
87 if (!verifySubExpr(Addr, Tmp))
88 return false;
89
90 if (!Tmp.empty()) {
91 errs() << "PHITransAddr contains extra instructions:\n";
92 for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
93 errs() << " InstInput #" << i << " is " << *InstInputs[i] << "\n";
94 llvm_unreachable("This is unexpected.");
95 }
96
97 // a-ok.
98 return true;
99}
100
101/// isPotentiallyPHITranslatable - If this needs PHI translation, return true
102/// if we have some hope of doing it. This should be used as a filter to
103/// avoid calling PHITranslateValue in hopeless situations.
105 // If the input value is not an instruction, or if it is not defined in CurBB,
106 // then we don't need to phi translate it.
108 return !Inst || canPHITrans(Inst);
109}
110
111static void RemoveInstInputs(Value *V,
112 SmallVectorImpl<Instruction*> &InstInputs) {
114 if (!I) return;
115
116 // If the instruction is in the InstInputs list, remove it.
117 if (auto Entry = find(InstInputs, I); Entry != InstInputs.end()) {
118 InstInputs.erase(Entry);
119 return;
120 }
121
122 assert(!isa<PHINode>(I) && "Error, removing something that isn't an input");
123
124 // Otherwise, it must have instruction inputs itself. Zap them recursively.
125 for (Value *Op : I->operands())
126 if (Instruction *OpInst = dyn_cast<Instruction>(Op))
127 RemoveInstInputs(OpInst, InstInputs);
128}
129
130Value *PHITransAddr::translateSubExpr(Value *V, BasicBlock *CurBB,
131 BasicBlock *PredBB,
132 const DominatorTree *DT, Value *Cond,
133 bool CondVal) {
134 // If this is a non-instruction value, it can't require PHI translation.
136 if (!Inst) return V;
137
138 // Determine whether 'Inst' is an input to our PHI translatable expression.
139 bool isInput = is_contained(InstInputs, Inst);
140
141 // Handle inputs instructions if needed.
142 if (isInput) {
143 if (Inst->getParent() != CurBB) {
144 // If it is an input defined in a different block, then it remains an
145 // input.
146 return Inst;
147 }
148
149 // If 'Inst' is defined in this block and is an input that needs to be phi
150 // translated, we need to incorporate the value into the expression or fail.
151
152 // In either case, the instruction itself isn't an input any longer.
153 InstInputs.erase(find(InstInputs, Inst));
154
155 // If this is a PHI, go ahead and translate it.
156 if (PHINode *PN = dyn_cast<PHINode>(Inst)) {
157 Value *Incoming = PN->getIncomingValueForBlock(PredBB);
158 // If the incoming value on this edge is a select on the condition we are
159 // resolving, fold it to the requested side. This is what lets us obtain
160 // the two distinct addresses referenced by a select-dependent load along
161 // a backedge (e.g. min/max idioms).
162 if (Cond)
163 if (auto *SI = dyn_cast<SelectInst>(Incoming))
164 if (SI->getCondition() == Cond)
165 return addAsInput(CondVal ? SI->getTrueValue()
166 : SI->getFalseValue());
167 return addAsInput(Incoming);
168 }
169
170 // If this is a non-phi value, and it is analyzable, we can incorporate it
171 // into the expression by making all instruction operands be inputs.
172 if (!canPHITrans(Inst))
173 return nullptr;
174
175 // All instruction operands are now inputs (and of course, they may also be
176 // defined in this block, so they may need to be phi translated themselves.
177 for (Value *Op : Inst->operands())
178 addAsInput(Op);
179 }
180
181 // Ok, it must be an intermediate result (either because it started that way
182 // or because we just incorporated it into the expression). See if its
183 // operands need to be phi translated, and if so, reconstruct it.
184
185 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
186 Value *PHIIn =
187 translateSubExpr(Cast->getOperand(0), CurBB, PredBB, DT, Cond, CondVal);
188 if (!PHIIn) return nullptr;
189 if (PHIIn == Cast->getOperand(0))
190 return Cast;
191
192 // Find an available version of this cast.
193
194 // Try to simplify cast first.
195 if (Value *V = simplifyCastInst(Cast->getOpcode(), PHIIn, Cast->getType(),
196 {DL, TLI, DT, AC})) {
197 RemoveInstInputs(PHIIn, InstInputs);
198 return addAsInput(V);
199 }
200
201 // Otherwise we have to see if a casted version of the incoming pointer
202 // is available. If so, we can use it, otherwise we have to fail. Don't
203 // scan the use list of a constant: ConstantData has no use list, and
204 // other constants may be used from different functions, whose blocks are
205 // not in this function's DominatorTree.
206 if (!isa<Constant>(PHIIn)) {
207 for (User *U : PHIIn->users()) {
208 if (CastInst *CastI = dyn_cast<CastInst>(U))
209 if (CastI->getOpcode() == Cast->getOpcode() &&
210 CastI->getType() == Cast->getType() &&
211 (!DT || DT->dominates(CastI->getParent(), PredBB)))
212 return CastI;
213 }
214 }
215 return nullptr;
216 }
217
218 // Handle getelementptr with at least one PHI translatable operand.
219 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) {
220 SmallVector<Value*, 8> GEPOps;
221 bool AnyChanged = false;
222 for (Value *Op : GEP->operands()) {
223 Value *GEPOp = translateSubExpr(Op, CurBB, PredBB, DT, Cond, CondVal);
224 if (!GEPOp) return nullptr;
225
226 AnyChanged |= GEPOp != Op;
227 GEPOps.push_back(GEPOp);
228 }
229
230 if (!AnyChanged)
231 return GEP;
232
233 // Simplify the GEP to handle 'gep x, 0' -> x etc.
234 if (Value *V = simplifyGEPInst(GEP->getSourceElementType(), GEPOps[0],
235 ArrayRef<Value *>(GEPOps).slice(1),
236 GEP->getNoWrapFlags(), {DL, TLI, DT, AC})) {
237 for (Value *Op : GEPOps)
238 RemoveInstInputs(Op, InstInputs);
239
240 return addAsInput(V);
241 }
242
243 // Scan to see if we have this GEP available.
244 Value *APHIOp = GEPOps[0];
245 if (isa<ConstantData>(APHIOp))
246 return nullptr;
247
248 for (User *U : APHIOp->users()) {
249 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U))
250 if (GEPI->getType() == GEP->getType() &&
251 GEPI->getSourceElementType() == GEP->getSourceElementType() &&
252 GEPI->getNumOperands() == GEPOps.size() &&
253 GEPI->getParent()->getParent() == CurBB->getParent() &&
254 (!DT || DT->dominates(GEPI->getParent(), PredBB))) {
255 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin()))
256 return GEPI;
257 }
258 }
259 return nullptr;
260 }
261
262 // Handle add with a constant RHS.
263 if (Inst->getOpcode() == Instruction::Add &&
264 isa<ConstantInt>(Inst->getOperand(1))) {
265 // PHI translate the LHS.
267 bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap();
268 bool isNUW = cast<BinaryOperator>(Inst)->hasNoUnsignedWrap();
269
270 Value *LHS =
271 translateSubExpr(Inst->getOperand(0), CurBB, PredBB, DT, Cond, CondVal);
272 if (!LHS) return nullptr;
273
274 // If the PHI translated LHS is an add of a constant, fold the immediates.
275 if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(LHS))
276 if (BOp->getOpcode() == Instruction::Add)
277 if (ConstantInt *CI = dyn_cast<ConstantInt>(BOp->getOperand(1))) {
278 LHS = BOp->getOperand(0);
280 isNSW = isNUW = false;
281
282 // If the old 'LHS' was an input, add the new 'LHS' as an input.
283 if (is_contained(InstInputs, BOp)) {
284 RemoveInstInputs(BOp, InstInputs);
285 addAsInput(LHS);
286 }
287 }
288
289 // See if the add simplifies away.
290 if (Value *Res = simplifyAddInst(LHS, RHS, isNSW, isNUW, {DL, TLI, DT, AC})) {
291 // If we simplified the operands, the LHS is no longer an input, but Res
292 // is.
293 RemoveInstInputs(LHS, InstInputs);
294 return addAsInput(Res);
295 }
296
297 // If we didn't modify the add, just return it.
298 if (LHS == Inst->getOperand(0) && RHS == Inst->getOperand(1))
299 return Inst;
300
301 // Otherwise, see if we have this add available somewhere.
302 for (User *U : LHS->users()) {
303 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U))
304 if (BO->getOpcode() == Instruction::Add &&
305 BO->getOperand(0) == LHS && BO->getOperand(1) == RHS &&
306 BO->getParent()->getParent() == CurBB->getParent() &&
307 (!DT || DT->dominates(BO->getParent(), PredBB)))
308 return BO;
309 }
310
311 return nullptr;
312 }
313
314 // Otherwise, we failed.
315 return nullptr;
316}
317
318/// PHITranslateValue - PHI translate the current address up the CFG from
319/// CurBB to Pred, updating our state to reflect any needed changes. If
320/// 'MustDominate' is true, the translated value must dominate PredBB.
322 const DominatorTree *DT,
323 bool MustDominate) {
324 assert(DT || !MustDominate);
325 assert(verify() && "Invalid PHITransAddr!");
326 if (DT && DT->isReachableFromEntry(PredBB))
327 Addr = translateSubExpr(Addr, CurBB, PredBB, DT);
328 else
329 Addr = nullptr;
330 assert(verify() && "Invalid PHITransAddr!");
331
332 if (MustDominate)
333 // Make sure the value is live in the predecessor.
335 if (!DT->dominates(Inst->getParent(), PredBB))
336 Addr = nullptr;
337
338 return Addr;
339}
340
342 BasicBlock *PredBB,
343 const DominatorTree *DT,
344 Value *Cond) {
345 assert(Cond && "expected a non-null select condition");
346 assert(verify() && "Invalid PHITransAddr!");
347
348 if (!DT || !DT->isReachableFromEntry(PredBB))
349 return {nullptr, nullptr};
350
351 auto TranslateSide = [&](bool CondVal) -> Value * {
352 // Work on a copy so that the original address state is preserved and the
353 // other side can be translated independently.
354 PHITransAddr Tmp(*this);
355 return Tmp.translateSubExpr(Tmp.Addr, CurBB, PredBB, DT, Cond, CondVal);
356 };
357
358 return {TranslateSide(/*CondVal=*/true), TranslateSide(/*CondVal=*/false)};
359}
360
362 for (Instruction *I : InstInputs)
363 if (auto *SI = dyn_cast<SelectInst>(I))
364 return SI->getCondition();
365 return nullptr;
366}
367
368/// PHITranslateWithInsertion - PHI translate this value into the specified
369/// predecessor block, inserting a computation of the value if it is
370/// unavailable.
371///
372/// All newly created instructions are added to the NewInsts list. This
373/// returns null on failure.
374///
375Value *
377 const DominatorTree &DT,
379 unsigned NISize = NewInsts.size();
380
381 // Attempt to PHI translate with insertion.
382 Addr = insertTranslatedSubExpr(Addr, CurBB, PredBB, DT, NewInsts);
383
384 // If successful, return the new value.
385 if (Addr) return Addr;
386
387 // If not, destroy any intermediate instructions inserted.
388 while (NewInsts.size() != NISize)
389 NewInsts.pop_back_val()->eraseFromParent();
390 return nullptr;
391}
392
393/// insertTranslatedSubExpr - Insert a computation of the PHI translated
394/// version of 'V' for the edge PredBB->CurBB into the end of the PredBB
395/// block. All newly created instructions are added to the NewInsts list.
396/// This returns null on failure.
397///
398Value *PHITransAddr::insertTranslatedSubExpr(
399 Value *InVal, BasicBlock *CurBB, BasicBlock *PredBB,
400 const DominatorTree &DT, SmallVectorImpl<Instruction *> &NewInsts) {
401 // See if we have a version of this value already available and dominating
402 // PredBB. If so, there is no need to insert a new instance of it.
403 PHITransAddr Tmp(InVal, DL, AC);
404 if (Value *Addr =
405 Tmp.translateValue(CurBB, PredBB, &DT, /*MustDominate=*/true))
406 return Addr;
407
408 // We don't need to PHI translate values which aren't instructions.
409 auto *Inst = dyn_cast<Instruction>(InVal);
410 if (!Inst)
411 return nullptr;
412
413 // Handle cast of PHI translatable value.
414 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
415 Value *OpVal = insertTranslatedSubExpr(Cast->getOperand(0), CurBB, PredBB,
416 DT, NewInsts);
417 if (!OpVal) return nullptr;
418
419 // Otherwise insert a cast at the end of PredBB.
420 CastInst *New = CastInst::Create(Cast->getOpcode(), OpVal, InVal->getType(),
421 InVal->getName() + ".phi.trans.insert",
422 PredBB->getTerminator()->getIterator());
423 New->setDebugLoc(Inst->getDebugLoc());
424 NewInsts.push_back(New);
425 return New;
426 }
427
428 // Handle getelementptr with at least one PHI operand.
431 BasicBlock *CurBB = GEP->getParent();
432 for (Value *Op : GEP->operands()) {
433 Value *OpVal = insertTranslatedSubExpr(Op, CurBB, PredBB, DT, NewInsts);
434 if (!OpVal) return nullptr;
435 GEPOps.push_back(OpVal);
436 }
437
438 GetElementPtrInst *Result = GetElementPtrInst::Create(
439 GEP->getSourceElementType(), GEPOps[0], ArrayRef(GEPOps).slice(1),
440 InVal->getName() + ".phi.trans.insert",
441 PredBB->getTerminator()->getIterator());
442 Result->setDebugLoc(Inst->getDebugLoc());
443 Result->setNoWrapFlags(GEP->getNoWrapFlags());
444 NewInsts.push_back(Result);
445 return Result;
446 }
447
448 // Handle add with a constant RHS.
449 if (EnableAddPhiTranslation && Inst->getOpcode() == Instruction::Add &&
450 isa<ConstantInt>(Inst->getOperand(1))) {
451
452 // FIXME: This code works, but it is unclear that we actually want to insert
453 // a big chain of computation in order to make a value available in a block.
454 // This needs to be evaluated carefully to consider its cost trade offs.
455
456 // PHI translate the LHS.
457 Value *OpVal = insertTranslatedSubExpr(Inst->getOperand(0), CurBB, PredBB,
458 DT, NewInsts);
459 if (OpVal == nullptr)
460 return nullptr;
461
462 BinaryOperator *Res = BinaryOperator::CreateAdd(
463 OpVal, Inst->getOperand(1), InVal->getName() + ".phi.trans.insert",
464 PredBB->getTerminator()->getIterator());
467 NewInsts.push_back(Res);
468 return Res;
469 }
470
471 return nullptr;
472}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition Compiler.h:672
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Hexagon Common GEP
static bool hasNoSignedWrap(BinaryOperator &I)
static bool hasNoUnsignedWrap(BinaryOperator &I)
#define I(x, y, z)
Definition MD5.cpp:57
static bool isInput(const ArrayRef< StringRef > &Prefixes, StringRef Arg)
Definition OptTable.cpp:148
static void RemoveInstInputs(Value *V, SmallVectorImpl< Instruction * > &InstInputs)
static bool canPHITrans(Instruction *Inst)
static cl::opt< bool > EnableAddPhiTranslation("gvn-add-phi-translation", cl::init(false), cl::Hidden, cl::desc("Enable phi-translation of add instructions"))
static bool verifySubExpr(Value *Expr, SmallVectorImpl< Instruction * > &InstInputs)
const SmallVectorImpl< MachineOperand > & Cond
Value * RHS
Value * LHS
LLVM Basic Block Representation.
Definition BasicBlock.h:62
const Function * getParent() const
Return the enclosing method, or null if none.
Definition BasicBlock.h:213
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Definition BasicBlock.h:237
This is the base class for all instructions that perform data casts.
Definition InstrTypes.h:512
static LLVM_ABI CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
static LLVM_ABI Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:151
LLVM_ABI bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
LLVM_ABI bool dominates(const BasicBlock *BB, const Use &U) const
Return true if the (end of the) basic block BB dominates the use U.
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
LLVM_ABI void setHasNoUnsignedWrap(bool b=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
LLVM_ABI void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
PHITransAddr - An address value which tracks and handles phi translation.
LLVM_ABI Value * translateValue(BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree *DT, bool MustDominate)
translateValue - PHI translate the current address up the CFG from CurBB to Pred, updating our state ...
LLVM_ABI void dump() const
PHITransAddr(Value *Addr, const DataLayout &DL, AssumptionCache *AC)
LLVM_ABI bool isPotentiallyPHITranslatable() const
isPotentiallyPHITranslatable - If this needs PHI translation, return true if we have some hope of doi...
LLVM_ABI Value * getSelectCondition() const
If the address expression depends on a select instruction (possibly through casts or GEPs),...
LLVM_ABI bool verify() const
verify - Check internal consistency of this data structure.
LLVM_ABI Value * translateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB, const DominatorTree &DT, SmallVectorImpl< Instruction * > &NewInsts)
translateWithInsertion - PHI translate this value into the specified predecessor block,...
std::pair< Value *, Value * > SelectAddrs
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
iterator erase(const_iterator CI)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
op_range operands()
Definition User.h:267
Value * getOperand(unsigned i) const
Definition User.h:207
LLVM Value Representation.
Definition Value.h:75
Type * getType() const
All values are typed, get the type of this value.
Definition Value.h:255
iterator_range< user_iterator > users()
Definition Value.h:426
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Definition Value.cpp:319
const ParentTy * getParent() const
Definition ilist_node.h:34
self_iterator getIterator()
Definition ilist_node.h:123
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
initializer< Ty > init(const Ty &Val)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1765
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1739
LLVM_ABI Value * simplifyGEPInst(Type *SrcTy, Value *Ptr, ArrayRef< Value * > Indices, GEPNoWrapFlags NW, const SimplifyQuery &Q)
Given operands for a GetElementPtrInst, fold the result or return null.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
LLVM_ABI Value * simplifyCastInst(unsigned CastOpc, Value *Op, Type *Ty, const SimplifyQuery &Q)
Given operands for a CastInst, fold the result or return null.
LLVM_ABI Value * simplifyAddInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW, const SimplifyQuery &Q)
Given operands for an Add, fold the result or return null.
auto dyn_cast_or_null(const Y &Val)
Definition Casting.h:753
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1947