diff options
author | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-03-17 15:04:27 +0000 |
---|---|---|
committer | Stephen Tozer <Stephen.Tozer@Sony.com> | 2021-03-17 16:45:25 +0000 |
commit | 3bfddc25931d44da9b26c092f4e15634712b1459 (patch) | |
tree | 1d46df6ec764c22fd1b16915b688ec105050ec42 /llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | |
parent | 410f09af09b9261f51663773bee01ec7b37e8fd4 (diff) | |
download | llvm-3bfddc25931d44da9b26c092f4e15634712b1459.zip llvm-3bfddc25931d44da9b26c092f4e15634712b1459.tar.gz llvm-3bfddc25931d44da9b26c092f4e15634712b1459.tar.bz2 |
Reapply "[DebugInfo] Handle multiple variable location operands in IR"
Fixed section of code that iterated through a SmallDenseMap and added
instructions in each iteration, causing non-deterministic code; replaced
SmallDenseMap with MapVector to prevent non-determinism.
This reverts commit 01ac6d1587e8613ba4278786e8341f8b492ac941.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopRotationUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp index 784d0e4..2c68e4b 100644 --- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp @@ -384,11 +384,14 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { // possible or create a clone in the OldPreHeader if not. Instruction *LoopEntryBranch = OrigPreheader->getTerminator(); - // Record all debug intrinsics preceding LoopEntryBranch to avoid duplication. + // Record all debug intrinsics preceding LoopEntryBranch to avoid + // duplication. using DbgIntrinsicHash = - std::pair<std::pair<Value *, DILocalVariable *>, DIExpression *>; + std::pair<std::pair<hash_code, DILocalVariable *>, DIExpression *>; auto makeHash = [](DbgVariableIntrinsic *D) -> DbgIntrinsicHash { - return {{D->getVariableLocationOp(0), D->getVariable()}, + auto VarLocOps = D->location_ops(); + return {{hash_combine_range(VarLocOps.begin(), VarLocOps.end()), + D->getVariable()}, D->getExpression()}; }; SmallDenseSet<DbgIntrinsicHash, 8> DbgIntrinsics; |