[llvm] 9a44760 - [UnifyLoopExits] Fix non-deterministic iteration order
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 01:10:18 PDT 2020
Author: Jay Foad
Date: 2020-09-14T09:09:58+01:00
New Revision: 9a4476072e152881e00179bef2c6da9fea9b274e
URL: https://github.com/llvm/llvm-project/commit/9a4476072e152881e00179bef2c6da9fea9b274e
DIFF: https://github.com/llvm/llvm-project/commit/9a4476072e152881e00179bef2c6da9fea9b274e.diff
LOG: [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
Added:
Modified:
llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp b/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
index b10deee3907c..6eacb9a20e4c 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) {
More information about the llvm-commits
mailing list