[CodeGenPrep] Change ValueToSExts from DeseMap to MapVector
authorHaohai Wen <haohai.wen@intel.com>
Fri, 4 Nov 2022 02:15:11 +0000 (10:15 +0800)
committerHaohai Wen <haohai.wen@intel.com>
Fri, 4 Nov 2022 03:15:18 +0000 (11:15 +0800)
mergeSExts iterates throught ValueToSExts. Using DenseMap result in
unstable optimization path so that output IR may vary even if the input
IR is same.

Reviewed By: wxiao3

Differential Revision: https://reviews.llvm.org/D137234

llvm/lib/CodeGen/CodeGenPrepare.cpp

index b9ffb8a..cf2b32c 100644 (file)
@@ -287,7 +287,7 @@ using SetOfInstrs = SmallPtrSet<Instruction *, 16>;
 using TypeIsSExt = PointerIntPair<Type *, 2, ExtType>;
 using InstrToOrigTy = DenseMap<Instruction *, TypeIsSExt>;
 using SExts = SmallVector<Instruction *, 16>;
-using ValueToSExts = DenseMap<Value *, SExts>;
+using ValueToSExts = MapVector<Value *, SExts>;
 
 class TypePromotionTransaction;