brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · a041f57 Raw
43 lines · plain
1; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck %s2 3; Check that the CodeGenPrepare Pass4; does not wrongly rewrite the address computed by Instruction %45; as [12 + Base:%this].6 7; This test makes sure that:8; - both the store and the first load instructions9;   within basic block labeled 'if.then' are not removed. 10; - the store instruction stores a value at address [60 + %this]11; - the first load instruction loads a value at address [12 + %this]12 13%class.A = type { %struct.B }14%struct.B = type { %class.C, %class.D, %class.C, %class.D }15%class.C = type { float, float, float }16%class.D = type { [3 x %class.C] }17 18define linkonce_odr void @foo(ptr nocapture %this, i32 %BoolValue) nounwind uwtable {19entry:20  %cmp = icmp eq i32 %BoolValue, 021  %address1 = getelementptr inbounds %class.A, ptr %this, i64 0, i32 0, i32 322  %address2 = getelementptr inbounds %class.A, ptr %this, i64 0, i32 0, i32 123  br i1 %cmp, label %if.else, label %if.then24 25if.then:                                         ; preds = %entry26  %0 = load float, ptr %address2, align 4 27  %1 = getelementptr inbounds float, ptr %address2, i64 328  %2 = load float, ptr %1, align 4 29  store float %0, ptr %address1, align 430  br label %if.end31 32if.else:                                          ; preds = %entry33  br label %if.end34 35if.end:                                           ; preds = %if.then, %if.else, %entry36  ret void37}38 39; CHECK-LABEL: foo:40; CHECK: movss 12([[THIS:%[a-zA-Z0-9]+]]), [[REGISTER:%[a-zA-Z0-9]+]]41; CHECK-NEXT: movss [[REGISTER]], 60([[THIS]])42 43