summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-04-26 16:37:05 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-04-26 16:37:05 +0000
commit2cbeb00f3842042accf64fcfc58be6ea3eba42fc (patch)
treec5a2da1f4f0a3ad6e499a9e825380f854601ad32 /llvm/lib/Target
parent9eed0bee3dcda9978ffad6df3e4af1db7d3ffab0 (diff)
downloadbcm5719-llvm-2cbeb00f3842042accf64fcfc58be6ea3eba42fc.tar.gz
bcm5719-llvm-2cbeb00f3842042accf64fcfc58be6ea3eba42fc.zip
Reverts commit r301424, r301425 and r301426
Commits were: "Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts" "Add a new WeakVH value handle; NFC" "Rename WeakVH to WeakTrackingVH; NFC" The changes assumed pointers are 8 byte aligned on all architectures. llvm-svn: 301429
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp18
-rw-r--r--llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp10
2 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
index d8cb98fe1b1..b7e62075244 100644
--- a/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
+++ b/llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
@@ -77,10 +77,9 @@ class SIAnnotateControlFlow : public FunctionPass {
void insertElse(BranchInst *Term);
- Value *
- handleLoopCondition(Value *Cond, PHINode *Broken, llvm::Loop *L,
- BranchInst *Term,
- SmallVectorImpl<WeakTrackingVH> &LoopPhiConditions);
+ Value *handleLoopCondition(Value *Cond, PHINode *Broken,
+ llvm::Loop *L, BranchInst *Term,
+ SmallVectorImpl<WeakVH> &LoopPhiConditions);
void handleLoop(BranchInst *Term);
@@ -213,8 +212,9 @@ void SIAnnotateControlFlow::insertElse(BranchInst *Term) {
/// \brief Recursively handle the condition leading to a loop
Value *SIAnnotateControlFlow::handleLoopCondition(
- Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term,
- SmallVectorImpl<WeakTrackingVH> &LoopPhiConditions) {
+ Value *Cond, PHINode *Broken,
+ llvm::Loop *L, BranchInst *Term,
+ SmallVectorImpl<WeakVH> &LoopPhiConditions) {
// Only search through PHI nodes which are inside the loop. If we try this
// with PHI nodes that are outside of the loop, we end up inserting new PHI
@@ -281,7 +281,7 @@ Value *SIAnnotateControlFlow::handleLoopCondition(
NewPhi->setIncomingValue(i, PhiArg);
}
- LoopPhiConditions.push_back(WeakTrackingVH(Phi));
+ LoopPhiConditions.push_back(WeakVH(Phi));
return Ret;
}
@@ -323,7 +323,7 @@ void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
BasicBlock *Target = Term->getSuccessor(1);
PHINode *Broken = PHINode::Create(Int64, 0, "phi.broken", &Target->front());
- SmallVector<WeakTrackingVH, 8> LoopPhiConditions;
+ SmallVector<WeakVH, 8> LoopPhiConditions;
Value *Cond = Term->getCondition();
Term->setCondition(BoolTrue);
Value *Arg = handleLoopCondition(Cond, Broken, L, Term, LoopPhiConditions);
@@ -333,7 +333,7 @@ void SIAnnotateControlFlow::handleLoop(BranchInst *Term) {
Term->setCondition(CallInst::Create(Loop, Arg, "", Term));
- for (WeakTrackingVH Val : reverse(LoopPhiConditions)) {
+ for (WeakVH Val : reverse(LoopPhiConditions)) {
if (PHINode *Cond = cast_or_null<PHINode>(Val))
eraseIfUnused(Cond);
}
diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
index 87532d11ede..5cc51cd7a99 100644
--- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
+++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
@@ -128,11 +128,11 @@ createReplacementInstr(ConstantExpr *CE, Instruction *Instr) {
static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
do {
- SmallVector<WeakTrackingVH, 8> WUsers(CE->user_begin(), CE->user_end());
+ SmallVector<WeakVH,8> WUsers(CE->user_begin(), CE->user_end());
std::sort(WUsers.begin(), WUsers.end());
WUsers.erase(std::unique(WUsers.begin(), WUsers.end()), WUsers.end());
while (!WUsers.empty())
- if (WeakTrackingVH WU = WUsers.pop_back_val()) {
+ if (WeakVH WU = WUsers.pop_back_val()) {
if (PHINode *PN = dyn_cast<PHINode>(WU)) {
for (int I = 0, E = PN->getNumIncomingValues(); I < E; ++I)
if (PN->getIncomingValue(I) == CE) {
@@ -159,12 +159,12 @@ static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
}
static bool rewriteNonInstructionUses(GlobalVariable *GV, Pass *P) {
- SmallVector<WeakTrackingVH, 8> WUsers;
+ SmallVector<WeakVH,8> WUsers;
for (User *U : GV->users())
if (!isa<Instruction>(U))
- WUsers.push_back(WeakTrackingVH(U));
+ WUsers.push_back(WeakVH(U));
while (!WUsers.empty())
- if (WeakTrackingVH WU = WUsers.pop_back_val()) {
+ if (WeakVH WU = WUsers.pop_back_val()) {
ConstantExpr *CE = dyn_cast<ConstantExpr>(WU);
if (!CE || !replaceConstantExprOp(CE, P))
return false;
OpenPOWER on IntegriCloud