aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2020-09-11 22:00:36 +0100
committerJay Foad <jay.foad@amd.com>2020-09-14 09:09:58 +0100
commit9a4476072e152881e00179bef2c6da9fea9b274e (patch)
tree1547f4c1b6ee1484de2fee06f6aff8279a0a3b04 /llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
parent4946802c5f406b050cbb1524d0fd03cf3fd7b0dc (diff)
downloadllvm-9a4476072e152881e00179bef2c6da9fea9b274e.zip
llvm-9a4476072e152881e00179bef2c6da9fea9b274e.tar.gz
llvm-9a4476072e152881e00179bef2c6da9fea9b274e.tar.bz2
[UnifyLoopExits] Fix non-deterministic iteration order
This was causing random minor codegen differences in shaders compiled with the AMDGPU backend. Differential Revision: https://reviews.llvm.org/D87548
Diffstat (limited to 'llvm/lib/Transforms/Utils/UnifyLoopExits.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/UnifyLoopExits.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp b/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
index b10deee..6eacb9a 100644
--- a/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
+++ b/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
@@ -16,6 +16,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/MapVector.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/InitializePasses.h"
@@ -80,7 +81,7 @@ static void restoreSSA(const DominatorTree &DT, const Loop *L,
const SetVector<BasicBlock *> &Incoming,
BasicBlock *LoopExitBlock) {
using InstVector = SmallVector<Instruction *, 8>;
- using IIMap = DenseMap<Instruction *, InstVector>;
+ using IIMap = MapVector<Instruction *, InstVector>;
IIMap ExternalUsers;
for (auto BB : L->blocks()) {
for (auto &I : *BB) {