[PATCH] D33667: [MC] Fix constant pools with DenseMap sentinel values

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 02:37:39 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL304199: [MC] Fix constant pools with DenseMap sentinel values (authored by olista01).

Changed prior to commit:
  https://reviews.llvm.org/D33667?vs=100671&id=100676#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33667

Files:
  llvm/trunk/include/llvm/MC/ConstantPools.h
  llvm/trunk/test/MC/AArch64/ldr-pseudo.s


Index: llvm/trunk/include/llvm/MC/ConstantPools.h
===================================================================
--- llvm/trunk/include/llvm/MC/ConstantPools.h
+++ llvm/trunk/include/llvm/MC/ConstantPools.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/SMLoc.h"
 #include <cstdint>
+#include <map>
 
 namespace llvm {
 
@@ -44,7 +45,7 @@
 class ConstantPool {
   using EntryVecTy = SmallVector<ConstantPoolEntry, 4>;
   EntryVecTy Entries;
-  DenseMap<int64_t, const MCSymbolRefExpr *> CachedEntries;
+  std::map<int64_t, const MCSymbolRefExpr *> CachedEntries;
 
 public:
   // Initialize a new empty constant pool
Index: llvm/trunk/test/MC/AArch64/ldr-pseudo.s
===================================================================
--- llvm/trunk/test/MC/AArch64/ldr-pseudo.s
+++ llvm/trunk/test/MC/AArch64/ldr-pseudo.s
@@ -205,6 +205,13 @@
   ldr x1, =0x320064
 // CHECK: ldr x1, .Ltmp[[TMP26:[0-9]+]]
 
+// We previously used a DenseMap with constant values as keys, check that
+// sentinel values can be used.
+  ldr x0, =0x7ffffffffffffffe
+// CHECK: ldr x0, .Ltmp[[TMP27:[0-9]+]]
+  ldr x1, =0x7fffffffffffffff
+// CHECK: ldr x1, .Ltmp[[TMP28:[0-9]+]]
+
 //
 // Constant Pools
 //
@@ -311,3 +318,8 @@
 // CHECK: .p2align 2
 // CHECK: .Ltmp[[TMP25]]
 // CHECK: .word 3276900
+
+// CHECK: .Ltmp[[TMP27]]
+// CHECK: .xword 9223372036854775806
+// CHECK: .Ltmp[[TMP28]]
+// CHECK: .xword 9223372036854775807


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33667.100676.patch
Type: text/x-patch
Size: 1444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/64ce0a60/attachment.bin>


More information about the llvm-commits mailing list