Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: tests_lit/llvm2ice_tests/reorder-pooled-constants.ll

Issue 1206723003: Function Layout, Global Variable Layout and Pooled Constants Layout Reordering (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; This is a smoke test for floating-point constant pooling. It tests 1 ; This is a smoke test for reordering pooled constants.
2 ; pooling of various float and double constants (including positive 2 ; This option is only implemented for target X8632 for now.
3 ; and negative NaN) within functions and across functions. Note that
4 ; in LLVM bitcode, hex constants are used for an FP constant whenever
5 ; the constant "cannot be represented as a decimal floating point
6 ; number in a reasonable number of digits". See
7 ; http://llvm.org/docs/LangRef.html#simple-constants .
8 3
9 ; RUN: %p2i --assemble --disassemble --filetype=obj --dis-flags=-s \ 4 ; RUN: %p2i --assemble --disassemble --filetype=obj --dis-flags=-s \
10 ; RUN: -i %s --args -O2 --verbose none | FileCheck %s 5 ; RUN: --target x8632 -i %s --args -sz-seed=1 -O2 -reorder-pooled-constants \
6 ; RUN: | FileCheck %s --check-prefix=X86O2
7
11 ; RUN: %p2i --assemble --disassemble --filetype=obj --dis-flags=-s \ 8 ; RUN: %p2i --assemble --disassemble --filetype=obj --dis-flags=-s \
12 ; RUN: -i %s --args -Om1 --verbose none | FileCheck %s 9 ; RUN: --target x8632 -i %s --args -sz-seed=1 -Om1 -reorder-pooled-constants \
13 10 ; RUN: | FileCheck %s --check-prefix=X86OM1
14 ; RUN: %if --need allow_dump --command %p2i --assemble --disassemble \
15 ; RUN: --dis-flags=-s -i %s --args -O2 --verbose none \
16 ; RUN: | %if --need allow_dump --command FileCheck %s
17 ; RUN: %if --need allow_dump --command %p2i --assemble --disassemble \
18 ; RUN: --dis-flags=-s -i %s --args -Om1 --verbose none \
19 ; RUN: | %if --need allow_dump --command FileCheck %s
20 11
21 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 12 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4
22 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 13 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4
23 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 14 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8
24 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 15 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4
25 16
26 define internal float @FpLookup1(i32 %Arg) { 17 define internal float @FpLookup1(i32 %Arg) {
27 entry: 18 entry:
28 switch i32 %Arg, label %return [ 19 switch i32 %Arg, label %return [
29 i32 0, label %sw.bb 20 i32 0, label %sw.bb
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 %call66 = call float @Dummy(i32 -110) 525 %call66 = call float @Dummy(i32 -110)
535 %conv67 = fpext float %call66 to double 526 %conv67 = fpext float %call66 to double
536 %add68 = fadd double %conv67, 0xFFF8000000000000 527 %add68 = fadd double %conv67, 0xFFF8000000000000
537 br label %return 528 br label %return
538 529
539 return: ; preds = %entry, %sw.bb65, %s w.bb61, %sw.bb57, %sw.bb53, %sw.bb49, %sw.bb45, %sw.bb41, %sw.bb37, %sw.bb33, %s w.bb29, %sw.bb25, %sw.bb21, %sw.bb17, %sw.bb13, %sw.bb9, %sw.bb5, %sw.bb1, %sw.b b 530 return: ; preds = %entry, %sw.bb65, %s w.bb61, %sw.bb57, %sw.bb53, %sw.bb49, %sw.bb45, %sw.bb41, %sw.bb37, %sw.bb33, %s w.bb29, %sw.bb25, %sw.bb21, %sw.bb17, %sw.bb13, %sw.bb9, %sw.bb5, %sw.bb1, %sw.b b
540 %retval.0 = phi double [ %add68, %sw.bb65 ], [ %add64, %sw.bb61 ], [ %add60, % sw.bb57 ], [ %add56, %sw.bb53 ], [ %add52, %sw.bb49 ], [ %conv48, %sw.bb45 ], [ %conv44, %sw.bb41 ], [ %conv40, %sw.bb37 ], [ %conv36, %sw.bb33 ], [ %add32, %sw .bb29 ], [ %add28, %sw.bb25 ], [ %add24, %sw.bb21 ], [ %add20, %sw.bb17 ], [ %ad d16, %sw.bb13 ], [ %conv12, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ], [ 0.000000e+00, %entry ] 531 %retval.0 = phi double [ %add68, %sw.bb65 ], [ %add64, %sw.bb61 ], [ %add60, % sw.bb57 ], [ %add56, %sw.bb53 ], [ %add52, %sw.bb49 ], [ %conv48, %sw.bb45 ], [ %conv44, %sw.bb41 ], [ %conv40, %sw.bb37 ], [ %conv36, %sw.bb33 ], [ %add32, %sw .bb29 ], [ %add28, %sw.bb25 ], [ %add24, %sw.bb21 ], [ %add20, %sw.bb17 ], [ %ad d16, %sw.bb13 ], [ %conv12, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ], [ %conv, %sw.bb ], [ 0.000000e+00, %entry ]
541 ret double %retval.0 532 ret double %retval.0
542 } 533 }
543 534
544 ; The FP constant pool entries for each type are dumped in some 535 ; Make sure the constants in pools are shuffled.
545 ; implementation-dependent order. So for the purposes of lit, we just 536 ; TODO(qining, stichnot): Om1 and O2 result into different sizes of i32 constant
Jim Stichnoth 2015/06/26 01:54:57 This isn't really a TODO, just an explanation of t
qining 2015/06/26 03:16:08 Done. Add following sentence to the top: TODO(qini
546 ; pick one value for each type, and make sure it appears exactly once. 537 ; pools. Because the shuffling routine of constant pools is applied to integer
538 ; constant pools first, the random number used for shuffling float and double
539 ; constant pools will be different for Om1 and O2, so is the order of the pooled
540 ; float and double constants. The source of this difference may includes: stack
541 ; frame size, strength reduction, etc.
547 542
548 ; Check for float 0.5 543 ; Check for float pool
549 ; CHECK-LABEL: .rodata.cst4 544 ; X86O2-LABEL: .rodata.cst4
550 ; CHECK: 0000003f 545 ; X86O2: 00000040 0000c0ff 00000041 00000000
551 ; CHECK-NOT: 0000003f 546 ; X86O2: 0000003f 0000803f 00008040 0000c07f
547 ; X86O2: 0000803e
552 548
553 ; Check for double 0.5 549 ; Check for double pool
554 ; CHECK-LABEL: .rodata.cst8 550 ; X86O2-LABEL: .rodata.cst8
555 ; CHECK: 00000000 0000e03f 551 ; X86O2: 55555555 5555d53f 00000000 0000f8ff
556 ; CHECK-NOT: 00000000 0000e03f 552 ; X86O2: 00000000 0000f87f 00000000 0000e03f
557 ; CHECK-LABEL: .text 553 ; X86O2: 00000000 0000d03f 00000000 00000000
554
555 ; X86O2-LABEL: .text
556
557 ; Check for float pool
558 ; X86OM1-LABEL: .rodata.cst4
559 ; X86OM1: 0000803f 0000003f 00000040 0000c0ff
560 ; X86OM1: 00000000 00008040 0000c07f 0000803e
561 ; X86OM1: 00000041
562
563 ; Check for double pool
564 ; X86OM1-LABEL: .rodata.cst8
565 ; X86OM1: 00000000 0000e03f 00000000 0000f87f
566 ; X86OM1: 00000000 0000f8ff 00000000 0000d03f
567 ; X86OM1: 00000000 00000000 55555555 5555d53f
568
569 ; X86OM1-LABEL: .text
OLDNEW
« src/IceGlobalContext.cpp ('K') | « tests_lit/llvm2ice_tests/reorder-global-variables.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698