@@ -711,8 +711,7 @@ bool X86FastISel::handleConstantAddresses(const Value *V, X86AddressMode &AM) {
711
711
// Handle constant address.
712
712
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
713
713
// Can't handle alternate code models yet.
714
- if (TM.getCodeModel () != CodeModel::Small &&
715
- TM.getCodeModel () != CodeModel::Medium)
714
+ if (TM.getCodeModel () != CodeModel::Small)
716
715
return false ;
717
716
718
717
// Can't handle TLS yet.
@@ -1045,8 +1044,7 @@ bool X86FastISel::X86SelectCallAddress(const Value *V, X86AddressMode &AM) {
1045
1044
// Handle constant address.
1046
1045
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
1047
1046
// Can't handle alternate code models yet.
1048
- if (TM.getCodeModel () != CodeModel::Small &&
1049
- TM.getCodeModel () != CodeModel::Medium)
1047
+ if (TM.getCodeModel () != CodeModel::Small)
1050
1048
return false ;
1051
1049
1052
1050
// RIP-relative addresses can't have additional register operands.
@@ -3771,8 +3769,7 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) {
3771
3769
3772
3770
// Can't handle alternate code models yet.
3773
3771
CodeModel::Model CM = TM.getCodeModel ();
3774
- if (CM != CodeModel::Small && CM != CodeModel::Medium &&
3775
- CM != CodeModel::Large)
3772
+ if (CM != CodeModel::Small && CM != CodeModel::Large)
3776
3773
return 0 ;
3777
3774
3778
3775
// Get opcode and regclass of the output for the given load instruction.
@@ -3810,7 +3807,7 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) {
3810
3807
PICBase = getInstrInfo ()->getGlobalBaseReg (FuncInfo.MF );
3811
3808
else if (OpFlag == X86II::MO_GOTOFF)
3812
3809
PICBase = getInstrInfo ()->getGlobalBaseReg (FuncInfo.MF );
3813
- else if (Subtarget->is64Bit () && TM.getCodeModel () != CodeModel::Large )
3810
+ else if (Subtarget->is64Bit () && TM.getCodeModel () == CodeModel::Small )
3814
3811
PICBase = X86::RIP;
3815
3812
3816
3813
// Create the load from the constant pool.
@@ -3840,11 +3837,8 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) {
3840
3837
}
3841
3838
3842
3839
unsigned X86FastISel::X86MaterializeGV (const GlobalValue *GV, MVT VT) {
3843
- // Can't handle large GlobalValues yet.
3844
- if (TM.getCodeModel () != CodeModel::Small &&
3845
- TM.getCodeModel () != CodeModel::Medium)
3846
- return 0 ;
3847
- if (!isa<GlobalObject>(GV) || TM.isLargeGlobalObject (cast<GlobalObject>(GV)))
3840
+ // Can't handle alternate code models yet.
3841
+ if (TM.getCodeModel () != CodeModel::Small)
3848
3842
return 0 ;
3849
3843
3850
3844
// Materialize addresses with LEA/MOV instructions.
0 commit comments