[PATCH] D23137: [WebAssembly] Fix CFI index for WebAssembly target to account for padding nullptr function

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 17:04:04 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL278073: [WebAssembly] Fix CFI index to account for padding nullptr function (authored by dschuff).

Changed prior to commit:
  https://reviews.llvm.org/D23137?vs=67091&id=67252#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23137

Files:
  llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
  llvm/trunk/test/CodeGen/WebAssembly/cfi.ll
  llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
  llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
  llvm/trunk/test/Transforms/LowerTypeTests/function.ll

Index: llvm/trunk/test/CodeGen/WebAssembly/cfi.ll
===================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/cfi.ll
+++ llvm/trunk/test/CodeGen/WebAssembly/cfi.ll
@@ -14,13 +14,13 @@
 }
 
 ; CHECK-LABEL: f:
-; CHECK: .indidx 0
+; CHECK: .indidx 1
 define void @f() !type !0 {
   ret void
 }
 
 ; CHECK-LABEL: g:
-; CHECK: .indidx 1
+; CHECK: .indidx 2
 define void @g() !type !1 {
   ret void
 }
Index: llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
===================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
@@ -32,14 +32,14 @@
 
 define i1 @foo(i8* %p) {
   ; X64: icmp eq i64 {{.*}}, ptrtoint ([1 x <{ i8, i32, i8, i8, i8 }>]* @[[JT0]] to i64)
-  ; WASM32: icmp eq i64 {{.*}}, 0
+  ; WASM32: icmp eq i64 {{.*}}, 1
   %x = call i1 @llvm.type.test(i8* %p, metadata !"typeid1")
   ; X64: icmp eq i64 {{.*}}, ptrtoint ([1 x <{ i8, i32, i8, i8, i8 }>]* @[[JT1]] to i64)
-  ; WASM32: icmp eq i64 {{.*}}, 1
+  ; WASM32: icmp eq i64 {{.*}}, 2
   %y = call i1 @llvm.type.test(i8* %p, metadata !"typeid2")
   %z = add i1 %x, %y
   ret i1 %z
 }
 
-; WASM32: ![[I0]] = !{i64 0}
-; WASM32: ![[I1]] = !{i64 1}
+; WASM32: ![[I0]] = !{i64 1}
+; WASM32: ![[I1]] = !{i64 2}
Index: llvm/trunk/test/Transforms/LowerTypeTests/function.ll
===================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function.ll
+++ llvm/trunk/test/Transforms/LowerTypeTests/function.ll
@@ -30,11 +30,11 @@
 
 define i1 @foo(i8* %p) {
   ; X64: sub i64 {{.*}}, ptrtoint ([2 x <{ i8, i32, i8, i8, i8 }>]* @[[JT]] to i64)
-  ; WASM32: sub i64 {{.*}}, 0
+  ; WASM32: sub i64 {{.*}}, 1
   ; WASM32: icmp ult i64 {{.*}}, 2
   %x = call i1 @llvm.type.test(i8* %p, metadata !"typeid1")
   ret i1 %x
 }
 
-; WASM32: ![[I0]] = !{i64 0}
-; WASM32: ![[I1]] = !{i64 1}
+; WASM32: ![[I0]] = !{i64 1}
+; WASM32: ![[I1]] = !{i64 2}
Index: llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
===================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
@@ -22,3 +22,4 @@
 
 !0 = !{i64 0, !"void"}
 ; WASM-NOT: !{i64 0}
+; WASM-NOT: !{i64 1}
Index: llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
+++ llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -822,6 +822,7 @@
 
   // Build consecutive monotonic integer ranges for each call target set
   DenseMap<GlobalObject *, uint64_t> GlobalLayout;
+
   for (Function *F : Functions) {
     // Skip functions that are not address taken, to avoid bloating the table
     if (!F->hasAddressTaken())
@@ -1049,7 +1050,7 @@
   LTT->Int64Ty = Type::getInt64Ty(M.getContext());
   LTT->IntPtrTy = DL.getIntPtrType(M.getContext(), 0);
   LTT->TypeTestCallSites.clear();
-  LTT->IndirectIndex = 0;
+  LTT->IndirectIndex = 1;
 }
 
 bool LowerTypeTests::runOnModule(Module &M) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23137.67252.patch
Type: text/x-patch
Size: 3184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160809/a3d83a82/attachment.bin>


More information about the llvm-commits mailing list