1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; It's not legal to fold a load from 32-bit stack slot into a 64-bit 4*9880d681SAndroid Build Coastguard Worker; instruction. If done, the instruction does a 64-bit load and that's not 5*9880d681SAndroid Build Coastguard Worker; safe. This can happen we a subreg_to_reg 0 has been coalesced. One 6*9880d681SAndroid Build Coastguard Worker; exception is when the instruction that folds the load is a move, then we 7*9880d681SAndroid Build Coastguard Worker; can simply turn it into a 32-bit load from the stack slot. 8*9880d681SAndroid Build Coastguard Worker; rdar://7170444 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker%struct.ComplexType = type { i32 } 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Workerdefine i32 @t(i32 %clientPort, i32 %pluginID, i32 %requestID, i32 %objectID, i64 %serverIdentifier, i64 %argumentsData, i32 %argumentsLength) ssp personality i32 (...)* @__gxx_personality_v0 { 13*9880d681SAndroid Build Coastguard Workerentry: 14*9880d681SAndroid Build Coastguard Worker; CHECK: _t: 15*9880d681SAndroid Build Coastguard Worker; CHECK: movl 16(%rbp), 16*9880d681SAndroid Build Coastguard Worker %0 = zext i32 %argumentsLength to i64 ; <i64> [#uses=1] 17*9880d681SAndroid Build Coastguard Worker %1 = zext i32 %clientPort to i64 ; <i64> [#uses=1] 18*9880d681SAndroid Build Coastguard Worker %2 = inttoptr i64 %1 to %struct.ComplexType* ; <%struct.ComplexType*> [#uses=1] 19*9880d681SAndroid Build Coastguard Worker %3 = invoke i8* @pluginInstance(i8* undef, i32 %pluginID) 20*9880d681SAndroid Build Coastguard Worker to label %invcont unwind label %lpad ; <i8*> [#uses=1] 21*9880d681SAndroid Build Coastguard Worker 22*9880d681SAndroid Build Coastguard Workerinvcont: ; preds = %entry 23*9880d681SAndroid Build Coastguard Worker %4 = add i32 %requestID, %pluginID ; <i32> [#uses=0] 24*9880d681SAndroid Build Coastguard Worker %5 = invoke zeroext i8 @invoke(i8* %3, i32 %objectID, i8* undef, i64 %argumentsData, i32 %argumentsLength, i64* undef, i32* undef) 25*9880d681SAndroid Build Coastguard Worker to label %invcont1 unwind label %lpad ; <i8> [#uses=0] 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Workerinvcont1: ; preds = %invcont 28*9880d681SAndroid Build Coastguard Worker %6 = getelementptr inbounds %struct.ComplexType, %struct.ComplexType* %2, i64 0, i32 0 ; <i32*> [#uses=1] 29*9880d681SAndroid Build Coastguard Worker %7 = load i32, i32* %6, align 4 ; <i32> [#uses=1] 30*9880d681SAndroid Build Coastguard Worker invoke void @booleanAndDataReply(i32 %7, i32 undef, i32 %requestID, i32 undef, i64 undef, i32 undef) 31*9880d681SAndroid Build Coastguard Worker to label %invcont2 unwind label %lpad 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Workerinvcont2: ; preds = %invcont1 34*9880d681SAndroid Build Coastguard Worker ret i32 0 35*9880d681SAndroid Build Coastguard Worker 36*9880d681SAndroid Build Coastguard Workerlpad: ; preds = %invcont1, %invcont, %entry 37*9880d681SAndroid Build Coastguard Worker %exn = landingpad {i8*, i32} 38*9880d681SAndroid Build Coastguard Worker cleanup 39*9880d681SAndroid Build Coastguard Worker %8 = call i32 @vm_deallocate(i32 undef, i64 0, i64 %0) ; <i32> [#uses=0] 40*9880d681SAndroid Build Coastguard Worker unreachable 41*9880d681SAndroid Build Coastguard Worker} 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Workerdeclare i32 @vm_deallocate(i32, i64, i64) 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Workerdeclare i8* @pluginInstance(i8*, i32) 46*9880d681SAndroid Build Coastguard Worker 47*9880d681SAndroid Build Coastguard Workerdeclare zeroext i8 @invoke(i8*, i32, i8*, i64, i32, i64*, i32*) 48*9880d681SAndroid Build Coastguard Worker 49*9880d681SAndroid Build Coastguard Workerdeclare void @booleanAndDataReply(i32, i32, i32, i32, i64, i32) 50*9880d681SAndroid Build Coastguard Worker 51*9880d681SAndroid Build Coastguard Workerdeclare i32 @__gxx_personality_v0(...) 52