[llvm] r317109 - Revert r317106 to facilitate reverting r317105.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 11:06:35 PDT 2017
Author: adrian
Date: Wed Nov 1 11:06:35 2017
New Revision: 317109
URL: http://llvm.org/viewvc/llvm-project?rev=317109&view=rev
Log:
Revert r317106 to facilitate reverting r317105.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
llvm/trunk/test/Transforms/LoopRotate/dbg-value-duplicates.ll
Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=317109&r1=317108&r2=317109&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Wed Nov 1 11:06:35 2017
@@ -25,7 +25,6 @@
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/CFG.h"
-#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
@@ -308,22 +307,6 @@ bool LoopRotate::rotateLoop(Loop *L, boo
// For the rest of the instructions, either hoist to the OrigPreheader if
// possible or create a clone in the OldPreHeader if not.
TerminatorInst *LoopEntryBranch = OrigPreheader->getTerminator();
-
- // Record all debug intrinsics preceding LoopEntryBranch to avoid duplication.
- using DbgIntrinsicHash =
- std::pair<std::pair<Value *, DILocalVariable *>, DIExpression *>;
- auto makeHash = [](DbgInfoIntrinsic *D) -> DbgIntrinsicHash {
- return {{D->getVariableLocation(), D->getVariable()}, D->getExpression()};
- };
- SmallDenseSet<DbgIntrinsicHash, 8> DbgIntrinsics;
- for (auto I = std::next(OrigPreheader->rbegin()), E = OrigPreheader->rend();
- I != E; ++I) {
- if (auto *DII = dyn_cast<DbgInfoIntrinsic>(&*I))
- DbgIntrinsics.insert(makeHash(DII));
- else
- break;
- }
-
while (I != E) {
Instruction *Inst = &*I++;
@@ -347,13 +330,6 @@ bool LoopRotate::rotateLoop(Loop *L, boo
RemapInstruction(C, ValueMap,
RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
- // Avoid inserting the same intrinsic twice.
- if (auto *DII = dyn_cast<DbgInfoIntrinsic>(C))
- if (DbgIntrinsics.count(makeHash(DII))) {
- C->deleteValue();
- continue;
- }
-
// With the operands remapped, see if the instruction constant folds or is
// otherwise simplifyable. This commonly occurs because the entry from PHI
// nodes allows icmps and other instructions to fold.
Modified: llvm/trunk/test/Transforms/LoopRotate/dbg-value-duplicates.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopRotate/dbg-value-duplicates.ll?rev=317109&r1=317108&r2=317109&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopRotate/dbg-value-duplicates.ll (original)
+++ llvm/trunk/test/Transforms/LoopRotate/dbg-value-duplicates.ll Wed Nov 1 11:06:35 2017
@@ -10,8 +10,6 @@ entry:
call void @llvm.dbg.value(metadata i64 %n, metadata !16, metadata !DIExpression()), !dbg !21
call void @llvm.dbg.value(metadata i64 %s, metadata !17, metadata !DIExpression()), !dbg !22
call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !23
- ; CHECK: call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !23
- ; CHECK-NOT: call void @llvm.dbg.value(metadata i64 0, metadata !18, metadata !DIExpression()), !dbg !23
br label %for.cond, !dbg !24
for.cond: ; preds = %for.body, %entry
More information about the llvm-commits
mailing list