Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions llvm/include/llvm/CodeGen/RegAllocPBQP.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef LLVM_CODEGEN_REGALLOCPBQP_H
#define LLVM_CODEGEN_REGALLOCPBQP_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/CodeGen/PBQP/CostAllocator.h"
Expand Down Expand Up @@ -191,10 +192,8 @@ class NodeMetadata {
everConservativelyAllocatable(Other.everConservativelyAllocatable)
#endif
{
if (NumOpts > 0) {
std::copy(&Other.OptUnsafeEdges[0], &Other.OptUnsafeEdges[NumOpts],
&OptUnsafeEdges[0]);
}
if (NumOpts > 0)
llvm::copy(Other.optUnsafeEdges(), &OptUnsafeEdges[0]);
}

NodeMetadata(NodeMetadata &&) = default;
Expand Down Expand Up @@ -243,9 +242,7 @@ class NodeMetadata {
}

bool isConservativelyAllocatable() const {
return (DeniedOpts < NumOpts) ||
(std::find(&OptUnsafeEdges[0], &OptUnsafeEdges[NumOpts], 0) !=
&OptUnsafeEdges[NumOpts]);
return (DeniedOpts < NumOpts) || llvm::is_contained(optUnsafeEdges(), 0);
}

#if LLVM_ENABLE_ABI_BREAKING_CHECKS
Expand All @@ -262,6 +259,10 @@ class NodeMetadata {
Register VReg;
GraphMetadata::AllowedRegVecRef AllowedRegs;

ArrayRef<unsigned> optUnsafeEdges() const {
return ArrayRef<unsigned>(OptUnsafeEdges.get(), NumOpts);
}

#if LLVM_ENABLE_ABI_BREAKING_CHECKS
bool everConservativelyAllocatable = false;
#endif
Expand Down