Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 37911b9

Browse files
committed
WholeProgramDevirt: Add import/export support for targets without absolute symbol constants.
Not all targets support the use of absolute symbols to export constants. In particular, ARM has a wide variety of constant encodings that cannot currently be relocated by linkers. So instead of exporting the constants using symbols, export them directly in the summary. The values of the constants are left as zeroes on targets that support symbolic exports. This may result in more cache misses when targeting those architectures as a result of arbitrary changes in constant values, but this seems somewhat unavoidable for now. Differential Revision: https://reviews.llvm.org/D37407 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312967 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d03e3c1 commit 37911b9

File tree

10 files changed

+114
-32
lines changed

10 files changed

+114
-32
lines changed

include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,12 @@ struct WholeProgramDevirtResolution {
510510
/// - UniqueRetVal: the return value associated with the unique vtable (0 or
511511
/// 1).
512512
uint64_t Info = 0;
513+
514+
// The following fields are only used if the target does not support the use
515+
// of absolute symbols to store constants.
516+
517+
uint32_t Byte = 0;
518+
uint32_t Bit = 0;
513519
};
514520

515521
/// Resolutions for calls with all constant integer arguments (excluding the

include/llvm/IR/ModuleSummaryIndexYAML.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ template <> struct MappingTraits<WholeProgramDevirtResolution::ByArg> {
5151
static void mapping(IO &io, WholeProgramDevirtResolution::ByArg &res) {
5252
io.mapOptional("Kind", res.TheKind);
5353
io.mapOptional("Info", res.Info);
54+
io.mapOptional("Byte", res.Byte);
55+
io.mapOptional("Bit", res.Bit);
5456
}
5557
};
5658

lib/LTO/LTO.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ static void computeCacheKey(
230230
AddUint64(Arg);
231231
AddUnsigned(ByArg.second.TheKind);
232232
AddUint64(ByArg.second.Info);
233+
AddUnsigned(ByArg.second.Byte);
234+
AddUnsigned(ByArg.second.Bit);
233235
}
234236
}
235237
};

lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,23 @@ struct DevirtModule {
467467
std::string getGlobalName(VTableSlot Slot, ArrayRef<uint64_t> Args,
468468
StringRef Name);
469469

470+
bool shouldExportConstantsAsAbsoluteSymbols();
471+
470472
// This function is called during the export phase to create a symbol
471473
// definition containing information about the given vtable slot and list of
472474
// arguments.
473475
void exportGlobal(VTableSlot Slot, ArrayRef<uint64_t> Args, StringRef Name,
474476
Constant *C);
477+
void exportConstant(VTableSlot Slot, ArrayRef<uint64_t> Args, StringRef Name,
478+
uint32_t Const, uint32_t &Storage);
475479

476480
// This function is called during the import phase to create a reference to
477481
// the symbol definition created during the export phase.
478482
Constant *importGlobal(VTableSlot Slot, ArrayRef<uint64_t> Args,
479-
StringRef Name, unsigned AbsWidth = 0);
483+
StringRef Name);
484+
Constant *importConstant(VTableSlot Slot, ArrayRef<uint64_t> Args,
485+
StringRef Name, IntegerType *IntTy,
486+
uint32_t Storage);
480487

481488
void applyUniqueRetValOpt(CallSiteInfo &CSInfo, StringRef FnName, bool IsOne,
482489
Constant *UniqueMemberAddr);
@@ -856,34 +863,68 @@ std::string DevirtModule::getGlobalName(VTableSlot Slot,
856863
return OS.str();
857864
}
858865

866+
bool DevirtModule::shouldExportConstantsAsAbsoluteSymbols() {
867+
Triple T(M.getTargetTriple());
868+
return (T.getArch() == Triple::x86 || T.getArch() == Triple::x86_64) &&
869+
T.getObjectFormat() == Triple::ELF;
870+
}
871+
859872
void DevirtModule::exportGlobal(VTableSlot Slot, ArrayRef<uint64_t> Args,
860873
StringRef Name, Constant *C) {
861874
GlobalAlias *GA = GlobalAlias::create(Int8Ty, 0, GlobalValue::ExternalLinkage,
862875
getGlobalName(Slot, Args, Name), C, &M);
863876
GA->setVisibility(GlobalValue::HiddenVisibility);
864877
}
865878

879+
void DevirtModule::exportConstant(VTableSlot Slot, ArrayRef<uint64_t> Args,
880+
StringRef Name, uint32_t Const,
881+
uint32_t &Storage) {
882+
if (shouldExportConstantsAsAbsoluteSymbols()) {
883+
exportGlobal(
884+
Slot, Args, Name,
885+
ConstantExpr::getIntToPtr(ConstantInt::get(Int32Ty, Const), Int8PtrTy));
886+
return;
887+
}
888+
889+
Storage = Const;
890+
}
891+
866892
Constant *DevirtModule::importGlobal(VTableSlot Slot, ArrayRef<uint64_t> Args,
867-
StringRef Name, unsigned AbsWidth) {
893+
StringRef Name) {
868894
Constant *C = M.getOrInsertGlobal(getGlobalName(Slot, Args, Name), Int8Ty);
869895
auto *GV = dyn_cast<GlobalVariable>(C);
896+
if (GV)
897+
GV->setVisibility(GlobalValue::HiddenVisibility);
898+
return C;
899+
}
900+
901+
Constant *DevirtModule::importConstant(VTableSlot Slot, ArrayRef<uint64_t> Args,
902+
StringRef Name, IntegerType *IntTy,
903+
uint32_t Storage) {
904+
if (!shouldExportConstantsAsAbsoluteSymbols())
905+
return ConstantInt::get(IntTy, Storage);
906+
907+
Constant *C = importGlobal(Slot, Args, Name);
908+
auto *GV = cast<GlobalVariable>(C->stripPointerCasts());
909+
C = ConstantExpr::getPtrToInt(C, IntTy);
910+
870911
// We only need to set metadata if the global is newly created, in which
871912
// case it would not have hidden visibility.
872-
if (!GV || GV->getVisibility() == GlobalValue::HiddenVisibility)
913+
if (GV->getMetadata(LLVMContext::MD_absolute_symbol))
873914
return C;
874915

875-
GV->setVisibility(GlobalValue::HiddenVisibility);
876916
auto SetAbsRange = [&](uint64_t Min, uint64_t Max) {
877917
auto *MinC = ConstantAsMetadata::get(ConstantInt::get(IntPtrTy, Min));
878918
auto *MaxC = ConstantAsMetadata::get(ConstantInt::get(IntPtrTy, Max));
879919
GV->setMetadata(LLVMContext::MD_absolute_symbol,
880920
MDNode::get(M.getContext(), {MinC, MaxC}));
881921
};
922+
unsigned AbsWidth = IntTy->getBitWidth();
882923
if (AbsWidth == IntPtrTy->getBitWidth())
883924
SetAbsRange(~0ull, ~0ull); // Full set.
884-
else if (AbsWidth)
925+
else
885926
SetAbsRange(0, 1ull << AbsWidth);
886-
return GV;
927+
return C;
887928
}
888929

889930
void DevirtModule::applyUniqueRetValOpt(CallSiteInfo &CSInfo, StringRef FnName,
@@ -1059,18 +1100,18 @@ bool DevirtModule::tryVirtualConstProp(
10591100
for (auto &&Target : TargetsForSlot)
10601101
Target.WasDevirt = true;
10611102

1062-
Constant *ByteConst = ConstantInt::get(Int32Ty, OffsetByte);
1063-
Constant *BitConst = ConstantInt::get(Int8Ty, 1ULL << OffsetBit);
10641103

10651104
if (CSByConstantArg.second.isExported()) {
10661105
ResByArg->TheKind = WholeProgramDevirtResolution::ByArg::VirtualConstProp;
1067-
exportGlobal(Slot, CSByConstantArg.first, "byte",
1068-
ConstantExpr::getIntToPtr(ByteConst, Int8PtrTy));
1069-
exportGlobal(Slot, CSByConstantArg.first, "bit",
1070-
ConstantExpr::getIntToPtr(BitConst, Int8PtrTy));
1106+
exportConstant(Slot, CSByConstantArg.first, "byte", OffsetByte,
1107+
ResByArg->Byte);
1108+
exportConstant(Slot, CSByConstantArg.first, "bit", 1ULL << OffsetBit,
1109+
ResByArg->Bit);
10711110
}
10721111

10731112
// Rewrite each call to a load from OffsetByte/OffsetBit.
1113+
Constant *ByteConst = ConstantInt::get(Int32Ty, OffsetByte);
1114+
Constant *BitConst = ConstantInt::get(Int8Ty, 1ULL << OffsetBit);
10741115
applyVirtualConstProp(CSByConstantArg.second,
10751116
TargetsForSlot[0].Fn->getName(), ByteConst, BitConst);
10761117
}
@@ -1301,10 +1342,10 @@ void DevirtModule::importResolution(VTableSlot Slot, VTableSlotInfo &SlotInfo) {
13011342
break;
13021343
}
13031344
case WholeProgramDevirtResolution::ByArg::VirtualConstProp: {
1304-
Constant *Byte = importGlobal(Slot, CSByConstantArg.first, "byte", 32);
1305-
Byte = ConstantExpr::getPtrToInt(Byte, Int32Ty);
1306-
Constant *Bit = importGlobal(Slot, CSByConstantArg.first, "bit", 8);
1307-
Bit = ConstantExpr::getPtrToInt(Bit, Int8Ty);
1345+
Constant *Byte = importConstant(Slot, CSByConstantArg.first, "byte",
1346+
Int32Ty, ResByArg.Byte);
1347+
Constant *Bit = importConstant(Slot, CSByConstantArg.first, "bit", Int8Ty,
1348+
ResByArg.Bit);
13081349
applyVirtualConstProp(CSByConstantArg.second, "", Byte, Bit);
13091350
}
13101351
default:

test/Transforms/WholeProgramDevirt/Inputs/import-vcp.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ TypeIdMap:
88
1:
99
Kind: VirtualConstProp
1010
Info: 0
11+
Byte: 42
12+
Bit: 0
1113
typeid2:
1214
WPDRes:
1315
8:
@@ -16,4 +18,6 @@ TypeIdMap:
1618
3:
1719
Kind: VirtualConstProp
1820
Info: 0
21+
Byte: 43
22+
Bit: 128
1923
...

test/Transforms/WholeProgramDevirt/export-uniform-ret-val.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
; SUMMARY-NEXT: 24,12:
1717
; SUMMARY-NEXT: Kind: UniformRetVal
1818
; SUMMARY-NEXT: Info: 36
19+
; SUMMARY-NEXT: Byte: 0
20+
; SUMMARY-NEXT: Bit: 0
1921

2022
; CHECK: @vt4a = constant i32 (i8*, i32, i32)* @vf4a
2123
@vt4a = constant i32 (i8*, i32, i32)* @vf4a, !type !0

test/Transforms/WholeProgramDevirt/export-unique-ret-val.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
; SUMMARY-NEXT: 12,24:
1717
; SUMMARY-NEXT: Kind: UniqueRetVal
1818
; SUMMARY-NEXT: Info: 0
19+
; SUMMARY-NEXT: Byte: 0
20+
; SUMMARY-NEXT: Bit: 0
1921
; SUMMARY-NEXT: typeid4:
2022
; SUMMARY-NEXT: TTRes:
2123
; SUMMARY-NEXT: Kind: Unsat
@@ -28,6 +30,8 @@
2830
; SUMMARY-NEXT: 24,12:
2931
; SUMMARY-NEXT: Kind: UniqueRetVal
3032
; SUMMARY-NEXT: Info: 1
33+
; SUMMARY-NEXT: Byte: 0
34+
; SUMMARY-NEXT: Bit: 0
3135

3236
; CHECK: @vt3a = constant i1 (i8*, i32, i32)* @vf3a
3337
@vt3a = constant i1 (i8*, i32, i32)* @vf3a, !type !0

test/Transforms/WholeProgramDevirt/export-vcp.ll

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
; RUN: opt -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck %s
2-
; RUN: FileCheck --check-prefix=SUMMARY %s < %t
1+
; RUN: opt -mtriple=x86_64-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,X86 %s
2+
; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-X86 %s < %t
3+
4+
; RUN: opt -mtriple=armv7-unknown-linux-gnu -wholeprogramdevirt -wholeprogramdevirt-summary-action=export -wholeprogramdevirt-read-summary=%S/Inputs/export.yaml -wholeprogramdevirt-write-summary=%t -S -o - %s | FileCheck --check-prefixes=CHECK,ARM %s
5+
; RUN: FileCheck --check-prefixes=SUMMARY,SUMMARY-ARM %s < %t
36

47
target datalayout = "e-p:64:64"
5-
target triple = "x86_64-unknown-linux-gnu"
68

79
; SUMMARY: TypeIdMap:
810
; SUMMARY-NEXT: typeid3:
@@ -17,6 +19,10 @@ target triple = "x86_64-unknown-linux-gnu"
1719
; SUMMARY-NEXT: 12,24:
1820
; SUMMARY-NEXT: Kind: VirtualConstProp
1921
; SUMMARY-NEXT: Info: 0
22+
; SUMMARY-X86-NEXT: Byte: 0
23+
; SUMMARY-X86-NEXT: Bit: 0
24+
; SUMMARY-ARM-NEXT: Byte: 4294967295
25+
; SUMMARY-ARM-NEXT: Bit: 1
2026
; SUMMARY-NEXT: typeid4:
2127
; SUMMARY-NEXT: TTRes:
2228
; SUMMARY-NEXT: Kind: Unsat
@@ -29,6 +35,10 @@ target triple = "x86_64-unknown-linux-gnu"
2935
; SUMMARY-NEXT: 24,12:
3036
; SUMMARY-NEXT: Kind: VirtualConstProp
3137
; SUMMARY-NEXT: Info: 0
38+
; SUMMARY-X86-NEXT: Byte: 0
39+
; SUMMARY-X86-NEXT: Bit: 0
40+
; SUMMARY-ARM-NEXT: Byte: 4294967292
41+
; SUMMARY-ARM-NEXT: Bit: 1
3242

3343
; CHECK: [[CVT3A:.*]] = private constant { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] zeroinitializer, i1 (i8*, i32, i32)* @vf0i1, [0 x i8] zeroinitializer }, !type !0
3444
@vt3a = constant i1 (i8*, i32, i32)* @vf0i1, !type !0
@@ -48,10 +58,11 @@ target triple = "x86_64-unknown-linux-gnu"
4858
; CHECK: [[CVT4B:.*]] = private constant { [8 x i8], i32 (i8*, i32, i32)*, [0 x i8] } { [8 x i8] c"\00\00\00\00\02\00\00\00", i32 (i8*, i32, i32)* @vf2i32, [0 x i8] zeroinitializer }, !type !1
4959
@vt4b = constant i32 (i8*, i32, i32)* @vf2i32, !type !1
5060

51-
; CHECK: @__typeid_typeid3_0_12_24_byte = hidden alias i8, inttoptr (i32 -1 to i8*)
52-
; CHECK: @__typeid_typeid3_0_12_24_bit = hidden alias i8, inttoptr (i8 1 to i8*)
53-
; CHECK: @__typeid_typeid4_0_24_12_byte = hidden alias i8, inttoptr (i32 -4 to i8*)
54-
; CHECK: @__typeid_typeid4_0_24_12_bit = hidden alias i8, inttoptr (i8 1 to i8*)
61+
; X86: @__typeid_typeid3_0_12_24_byte = hidden alias i8, inttoptr (i32 -1 to i8*)
62+
; X86: @__typeid_typeid3_0_12_24_bit = hidden alias i8, inttoptr (i32 1 to i8*)
63+
; X86: @__typeid_typeid4_0_24_12_byte = hidden alias i8, inttoptr (i32 -4 to i8*)
64+
; X86: @__typeid_typeid4_0_24_12_bit = hidden alias i8, inttoptr (i32 1 to i8*)
65+
; ARM-NOT: alias {{.*}} inttoptr
5566

5667
; CHECK: @vt3a = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3A]], i32 0, i32 1)
5768
; CHECK: @vt3b = alias i1 (i8*, i32, i32)*, getelementptr inbounds ({ [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }, { [8 x i8], i1 (i8*, i32, i32)*, [0 x i8] }* [[CVT3B]], i32 0, i32 1)

test/Transforms/WholeProgramDevirt/import-indir.ll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@
4444
; SUMMARY-NEXT: :
4545
; SUMMARY-NEXT: Kind: UniformRetVal
4646
; SUMMARY-NEXT: Info: 12
47+
; SUMMARY-NEXT: Byte: 0
48+
; SUMMARY-NEXT: Bit: 0
4749
; SUMMARY-NEXT: 12:
4850
; SUMMARY-NEXT: Kind: UniformRetVal
4951
; SUMMARY-NEXT: Info: 24
52+
; SUMMARY-NEXT: Byte: 0
53+
; SUMMARY-NEXT: Bit: 0
5054
; SUMMARY-NEXT: 12,24:
5155
; SUMMARY-NEXT: Kind: UniformRetVal
5256
; SUMMARY-NEXT: Info: 48
57+
; SUMMARY-NEXT: Byte: 0
58+
; SUMMARY-NEXT: Bit: 0
5359

5460
target datalayout = "e-p:32:32"
5561

test/Transforms/WholeProgramDevirt/import.ll

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-uniform-ret-val.yaml < %s | FileCheck --check-prefixes=CHECK,UNIFORM-RET-VAL %s
33
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-unique-ret-val0.yaml < %s | FileCheck --check-prefixes=CHECK,UNIQUE-RET-VAL0 %s
44
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-unique-ret-val1.yaml < %s | FileCheck --check-prefixes=CHECK,UNIQUE-RET-VAL1 %s
5-
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml < %s | FileCheck --check-prefixes=CHECK,VCP,VCP64 %s
6-
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml -mtriple=i686-unknown-linux -data-layout=e-p:32:32 < %s | FileCheck --check-prefixes=CHECK,VCP,VCP32 %s
5+
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml < %s | FileCheck --check-prefixes=CHECK,VCP,VCP-X86,VCP64 %s
6+
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml -mtriple=i686-unknown-linux -data-layout=e-p:32:32 < %s | FileCheck --check-prefixes=CHECK,VCP,VCP-X86,VCP32 %s
7+
; RUN: opt -S -wholeprogramdevirt -wholeprogramdevirt-summary-action=import -wholeprogramdevirt-read-summary=%S/Inputs/import-vcp.yaml -mtriple=armv7-unknown-linux -data-layout=e-p:32:32 < %s | FileCheck --check-prefixes=CHECK,VCP,VCP-ARM %s
78

89
target datalayout = "e-p:64:64"
910
target triple = "x86_64-unknown-linux-gnu"
1011

11-
; VCP: @__typeid_typeid1_0_1_byte = external hidden global i8, !absolute_symbol !0
12-
; VCP: @__typeid_typeid1_0_1_bit = external hidden global i8, !absolute_symbol !1
13-
; VCP: @__typeid_typeid2_8_3_byte = external hidden global i8, !absolute_symbol !0
14-
; VCP: @__typeid_typeid2_8_3_bit = external hidden global i8, !absolute_symbol !1
12+
; VCP-X86: @__typeid_typeid1_0_1_byte = external hidden global i8, !absolute_symbol !0
13+
; VCP-X86: @__typeid_typeid1_0_1_bit = external hidden global i8, !absolute_symbol !1
14+
; VCP-X86: @__typeid_typeid2_8_3_byte = external hidden global i8, !absolute_symbol !0
15+
; VCP-X86: @__typeid_typeid2_8_3_bit = external hidden global i8, !absolute_symbol !1
1516

1617
; Test cases where the argument values are known and we can apply virtual
1718
; constant propagation.
@@ -31,7 +32,8 @@ define i32 @call1(i8* %obj) {
3132
; UNIFORM-RET-VAL: ret i32 42
3233
; VCP: {{.*}} = bitcast {{.*}} to i8*
3334
; VCP: [[VT1:%.*]] = bitcast {{.*}} to i8*
34-
; VCP: [[GEP1:%.*]] = getelementptr i8, i8* [[VT1]], i32 ptrtoint (i8* @__typeid_typeid1_0_1_byte to i32)
35+
; VCP-X86: [[GEP1:%.*]] = getelementptr i8, i8* [[VT1]], i32 ptrtoint (i8* @__typeid_typeid1_0_1_byte to i32)
36+
; VCP-ARM: [[GEP1:%.*]] = getelementptr i8, i8* [[VT1]], i32 42
3537
; VCP: [[BC1:%.*]] = bitcast i8* [[GEP1]] to i32*
3638
; VCP: [[LOAD1:%.*]] = load i32, i32* [[BC1]]
3739
; VCP: ret i32 [[LOAD1]]
@@ -82,9 +84,11 @@ cont:
8284
; UNIQUE-RET-VAL0: icmp ne i8* %vtablei8, @__typeid_typeid2_8_3_unique_member
8385
; UNIQUE-RET-VAL1: icmp eq i8* %vtablei8, @__typeid_typeid2_8_3_unique_member
8486
; VCP: [[VT2:%.*]] = bitcast {{.*}} to i8*
85-
; VCP: [[GEP2:%.*]] = getelementptr i8, i8* [[VT2]], i32 ptrtoint (i8* @__typeid_typeid2_8_3_byte to i32)
87+
; VCP-X86: [[GEP2:%.*]] = getelementptr i8, i8* [[VT2]], i32 ptrtoint (i8* @__typeid_typeid2_8_3_byte to i32)
88+
; VCP-ARM: [[GEP2:%.*]] = getelementptr i8, i8* [[VT2]], i32 43
8689
; VCP: [[LOAD2:%.*]] = load i8, i8* [[GEP2]]
87-
; VCP: [[AND2:%.*]] = and i8 [[LOAD2]], ptrtoint (i8* @__typeid_typeid2_8_3_bit to i8)
90+
; VCP-X86: [[AND2:%.*]] = and i8 [[LOAD2]], ptrtoint (i8* @__typeid_typeid2_8_3_bit to i8)
91+
; VCP-ARM: [[AND2:%.*]] = and i8 [[LOAD2]], -128
8892
; VCP: [[ICMP2:%.*]] = icmp ne i8 [[AND2]], 0
8993
; VCP: ret i1 [[ICMP2]]
9094
ret i1 %result

0 commit comments

Comments
 (0)