diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-10-22 17:26:00 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-10-22 17:26:00 +0000 |
commit | b7f05872636b6eaf6f0b11b177b812dee891c19f (patch) | |
tree | 68de3ad2c2dca80940115e237b9dd19e2012f428 /test/CodeGenCXX/microsoft-abi-typeid.cpp | |
parent | c886ae8062c914804256420f20c918685da5d1b5 (diff) |
MS ABI: Emit more canonical vbptr stores and loads
This eliminates some i8* GEPs and makes the IR that clang emits a bit
more canonical. More work is needed for vftables, but that isn't a clear
win so I plan to send it for review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/microsoft-abi-typeid.cpp')
-rw-r--r-- | test/CodeGenCXX/microsoft-abi-typeid.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/CodeGenCXX/microsoft-abi-typeid.cpp b/test/CodeGenCXX/microsoft-abi-typeid.cpp index 4ee004d51d..1beb211812 100644 --- a/test/CodeGenCXX/microsoft-abi-typeid.cpp +++ b/test/CodeGenCXX/microsoft-abi-typeid.cpp @@ -31,11 +31,10 @@ const std::type_info* test3_typeid() { return &typeid(*fn()); } // CHECK: tail call i8* @__RTtypeid(i8* null) // CHECK-NEXT: unreachable // CHECK: [[THIS:%.*]] = bitcast %struct.A* [[CALL]] to i8* -// CHECK-NEXT: [[VBTBLP:%.*]] = bitcast %struct.A* [[CALL]] to i8** -// CHECK-NEXT: [[VBTBL:%.*]] = load i8** [[VBTBLP]], align 4 -// CHECK-NEXT: [[VBSLOT:%.*]] = getelementptr inbounds i8* [[VBTBL]], i32 4 -// CHECK-NEXT: [[VBITCST:%.*]] = bitcast i8* [[VBSLOT]] to i32* -// CHECK-NEXT: [[VBASE_OFFS:%.*]] = load i32* [[VBITCST]], align 4 +// CHECK-NEXT: [[VBTBLP:%.*]] = getelementptr inbounds %struct.A* [[CALL]], i32 0, i32 0 +// CHECK-NEXT: [[VBTBL:%.*]] = load i32** [[VBTBLP]], align 4 +// CHECK-NEXT: [[VBSLOT:%.*]] = getelementptr inbounds i32* [[VBTBL]], i32 1 +// CHECK-NEXT: [[VBASE_OFFS:%.*]] = load i32* [[VBSLOT]], align 4 // CHECK-NEXT: [[ADJ:%.*]] = getelementptr inbounds i8* [[THIS]], i32 [[VBASE_OFFS]] // CHECK-NEXT: [[RT:%.*]] = tail call i8* @__RTtypeid(i8* [[ADJ]]) // CHECK-NEXT: [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info* |