1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefix=NOFUSION_NOPOSTRA 3; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefixes=BRANCHFUSION_NOPOSTRA,BRANCHFUSIONONLY_NOPOSTRA 4; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefixes=BRANCHFUSION_NOPOSTRA,MACROFUSION_NOPOSTRA 5; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=NOFUSION_POSTRA 6; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=BRANCHFUSION_POSTRA 7; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=BRANCHFUSION_POSTRA 8; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=NOFUSION_MISCHEDPOSTRA 9; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=BRANCHFUSION_MISCHEDPOSTRA 10; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=BRANCHFUSION_MISCHEDPOSTRA 11 12 13 14; testb should be scheduled right before je to enable macro-fusion. 15 16define i32 @macrofuse_test_je(i32 %flags, i8* %p) nounwind { 17; NOFUSION_NOPOSTRA-LABEL: macrofuse_test_je: 18; NOFUSION_NOPOSTRA: # %bb.0: # %entry 19; NOFUSION_NOPOSTRA-NEXT: xorl %eax, %eax 20; NOFUSION_NOPOSTRA-NEXT: testl $512, %edi # imm = 0x200 21; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 22; NOFUSION_NOPOSTRA-NEXT: je .LBB0_2 23; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 24; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax 25; NOFUSION_NOPOSTRA-NEXT: .LBB0_2: # %if.end 26; NOFUSION_NOPOSTRA-NEXT: retq 27; 28; BRANCHFUSION_NOPOSTRA-LABEL: macrofuse_test_je: 29; BRANCHFUSION_NOPOSTRA: # %bb.0: # %entry 30; BRANCHFUSION_NOPOSTRA-NEXT: xorl %eax, %eax 31; BRANCHFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 32; BRANCHFUSION_NOPOSTRA-NEXT: testl $512, %edi # imm = 0x200 33; BRANCHFUSION_NOPOSTRA-NEXT: je .LBB0_2 34; BRANCHFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 35; BRANCHFUSION_NOPOSTRA-NEXT: movl $1, %eax 36; BRANCHFUSION_NOPOSTRA-NEXT: .LBB0_2: # %if.end 37; BRANCHFUSION_NOPOSTRA-NEXT: retq 38; 39; NOFUSION_POSTRA-LABEL: macrofuse_test_je: 40; NOFUSION_POSTRA: # %bb.0: # %entry 41; NOFUSION_POSTRA-NEXT: xorl %eax, %eax 42; NOFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200 43; NOFUSION_POSTRA-NEXT: movb $1, (%rsi) 44; NOFUSION_POSTRA-NEXT: je .LBB0_2 45; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then 46; NOFUSION_POSTRA-NEXT: movl $1, %eax 47; NOFUSION_POSTRA-NEXT: .LBB0_2: # %if.end 48; NOFUSION_POSTRA-NEXT: retq 49; 50; BRANCHFUSION_POSTRA-LABEL: macrofuse_test_je: 51; BRANCHFUSION_POSTRA: # %bb.0: # %entry 52; BRANCHFUSION_POSTRA-NEXT: xorl %eax, %eax 53; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi) 54; BRANCHFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200 55; BRANCHFUSION_POSTRA-NEXT: je .LBB0_2 56; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then 57; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax 58; BRANCHFUSION_POSTRA-NEXT: .LBB0_2: # %if.end 59; BRANCHFUSION_POSTRA-NEXT: retq 60; 61; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_test_je: 62; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 63; NOFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax 64; NOFUSION_MISCHEDPOSTRA-NEXT: testl $512, %edi # imm = 0x200 65; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 66; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB0_2 67; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 68; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 69; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB0_2: # %if.end 70; NOFUSION_MISCHEDPOSTRA-NEXT: retq 71; 72; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_test_je: 73; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 74; BRANCHFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax 75; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 76; BRANCHFUSION_MISCHEDPOSTRA-NEXT: testl $512, %edi # imm = 0x200 77; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB0_2 78; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 79; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 80; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB0_2: # %if.end 81; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq 82entry: 83 %and = and i32 %flags, 512 84 %tobool = icmp eq i32 %and, 0 85 store i8 1, i8* %p 86 br i1 %tobool, label %if.end, label %if.then 87 88if.then: 89 br label %if.end 90 91if.end: 92 %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ] 93 ret i32 %hasflag 94} 95 96define i32 @macrofuse_cmp_je(i32 %flags, i8* %p) nounwind { 97; NOFUSION_NOPOSTRA-LABEL: macrofuse_cmp_je: 98; NOFUSION_NOPOSTRA: # %bb.0: # %entry 99; NOFUSION_NOPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200 100; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 101; NOFUSION_NOPOSTRA-NEXT: je .LBB1_1 102; NOFUSION_NOPOSTRA-NEXT: # %bb.2: # %if.then 103; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax 104; NOFUSION_NOPOSTRA-NEXT: retq 105; NOFUSION_NOPOSTRA-NEXT: .LBB1_1: 106; NOFUSION_NOPOSTRA-NEXT: xorl %eax, %eax 107; NOFUSION_NOPOSTRA-NEXT: retq 108; 109; BRANCHFUSION_NOPOSTRA-LABEL: macrofuse_cmp_je: 110; BRANCHFUSION_NOPOSTRA: # %bb.0: # %entry 111; BRANCHFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 112; BRANCHFUSION_NOPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200 113; BRANCHFUSION_NOPOSTRA-NEXT: je .LBB1_1 114; BRANCHFUSION_NOPOSTRA-NEXT: # %bb.2: # %if.then 115; BRANCHFUSION_NOPOSTRA-NEXT: movl $1, %eax 116; BRANCHFUSION_NOPOSTRA-NEXT: retq 117; BRANCHFUSION_NOPOSTRA-NEXT: .LBB1_1: 118; BRANCHFUSION_NOPOSTRA-NEXT: xorl %eax, %eax 119; BRANCHFUSION_NOPOSTRA-NEXT: retq 120; 121; NOFUSION_POSTRA-LABEL: macrofuse_cmp_je: 122; NOFUSION_POSTRA: # %bb.0: # %entry 123; NOFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200 124; NOFUSION_POSTRA-NEXT: movb $1, (%rsi) 125; NOFUSION_POSTRA-NEXT: je .LBB1_1 126; NOFUSION_POSTRA-NEXT: # %bb.2: # %if.then 127; NOFUSION_POSTRA-NEXT: movl $1, %eax 128; NOFUSION_POSTRA-NEXT: retq 129; NOFUSION_POSTRA-NEXT: .LBB1_1: 130; NOFUSION_POSTRA-NEXT: xorl %eax, %eax 131; NOFUSION_POSTRA-NEXT: retq 132; 133; BRANCHFUSION_POSTRA-LABEL: macrofuse_cmp_je: 134; BRANCHFUSION_POSTRA: # %bb.0: # %entry 135; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi) 136; BRANCHFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200 137; BRANCHFUSION_POSTRA-NEXT: je .LBB1_1 138; BRANCHFUSION_POSTRA-NEXT: # %bb.2: # %if.then 139; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax 140; BRANCHFUSION_POSTRA-NEXT: retq 141; BRANCHFUSION_POSTRA-NEXT: .LBB1_1: 142; BRANCHFUSION_POSTRA-NEXT: xorl %eax, %eax 143; BRANCHFUSION_POSTRA-NEXT: retq 144; 145; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_cmp_je: 146; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 147; NOFUSION_MISCHEDPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200 148; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 149; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB1_1 150; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.2: # %if.then 151; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 152; NOFUSION_MISCHEDPOSTRA-NEXT: retq 153; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB1_1: 154; NOFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax 155; NOFUSION_MISCHEDPOSTRA-NEXT: retq 156; 157; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_cmp_je: 158; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 159; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 160; BRANCHFUSION_MISCHEDPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200 161; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB1_1 162; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.2: # %if.then 163; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 164; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq 165; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB1_1: 166; BRANCHFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax 167; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq 168entry: 169 %sub = sub i32 %flags, 512 170 %tobool = icmp eq i32 %sub, 0 171 store i8 1, i8* %p 172 br i1 %tobool, label %if.end, label %if.then 173 174if.then: 175 br label %if.end 176 177if.end: 178 %hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ] 179 ret i32 %hasflag 180} 181 182define i32 @macrofuse_alu_je(i32 %flags, i8* %p) nounwind { 183; NOFUSION_NOPOSTRA-LABEL: macrofuse_alu_je: 184; NOFUSION_NOPOSTRA: # %bb.0: # %entry 185; NOFUSION_NOPOSTRA-NEXT: movl %edi, %eax 186; NOFUSION_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 187; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 188; NOFUSION_NOPOSTRA-NEXT: je .LBB2_2 189; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 190; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax 191; NOFUSION_NOPOSTRA-NEXT: .LBB2_2: # %if.end 192; NOFUSION_NOPOSTRA-NEXT: retq 193; 194; BRANCHFUSIONONLY_NOPOSTRA-LABEL: macrofuse_alu_je: 195; BRANCHFUSIONONLY_NOPOSTRA: # %bb.0: # %entry 196; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl %edi, %eax 197; BRANCHFUSIONONLY_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 198; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movb $1, (%rsi) 199; BRANCHFUSIONONLY_NOPOSTRA-NEXT: je .LBB2_2 200; BRANCHFUSIONONLY_NOPOSTRA-NEXT: # %bb.1: # %if.then 201; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl $1, %eax 202; BRANCHFUSIONONLY_NOPOSTRA-NEXT: .LBB2_2: # %if.end 203; BRANCHFUSIONONLY_NOPOSTRA-NEXT: retq 204; 205; MACROFUSION_NOPOSTRA-LABEL: macrofuse_alu_je: 206; MACROFUSION_NOPOSTRA: # %bb.0: # %entry 207; MACROFUSION_NOPOSTRA-NEXT: movl %edi, %eax 208; MACROFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 209; MACROFUSION_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 210; MACROFUSION_NOPOSTRA-NEXT: je .LBB2_2 211; MACROFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 212; MACROFUSION_NOPOSTRA-NEXT: movl $1, %eax 213; MACROFUSION_NOPOSTRA-NEXT: .LBB2_2: # %if.end 214; MACROFUSION_NOPOSTRA-NEXT: retq 215; 216; NOFUSION_POSTRA-LABEL: macrofuse_alu_je: 217; NOFUSION_POSTRA: # %bb.0: # %entry 218; NOFUSION_POSTRA-NEXT: movl %edi, %eax 219; NOFUSION_POSTRA-NEXT: movb $1, (%rsi) 220; NOFUSION_POSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 221; NOFUSION_POSTRA-NEXT: je .LBB2_2 222; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then 223; NOFUSION_POSTRA-NEXT: movl $1, %eax 224; NOFUSION_POSTRA-NEXT: .LBB2_2: # %if.end 225; NOFUSION_POSTRA-NEXT: retq 226; 227; BRANCHFUSION_POSTRA-LABEL: macrofuse_alu_je: 228; BRANCHFUSION_POSTRA: # %bb.0: # %entry 229; BRANCHFUSION_POSTRA-NEXT: movl %edi, %eax 230; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi) 231; BRANCHFUSION_POSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 232; BRANCHFUSION_POSTRA-NEXT: je .LBB2_2 233; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then 234; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax 235; BRANCHFUSION_POSTRA-NEXT: .LBB2_2: # %if.end 236; BRANCHFUSION_POSTRA-NEXT: retq 237; 238; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_alu_je: 239; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 240; NOFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax 241; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 242; NOFUSION_MISCHEDPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 243; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB2_2 244; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 245; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 246; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB2_2: # %if.end 247; NOFUSION_MISCHEDPOSTRA-NEXT: retq 248; 249; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_alu_je: 250; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 251; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax 252; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 253; BRANCHFUSION_MISCHEDPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00 254; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB2_2 255; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 256; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 257; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB2_2: # %if.end 258; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq 259entry: 260 %sub = sub i32 %flags, 512 261 %tobool = icmp eq i32 %sub, 0 262 store i8 1, i8* %p 263 br i1 %tobool, label %if.end, label %if.then 264 265if.then: 266 br label %if.end 267 268if.end: 269 %hasflag = phi i32 [ 1, %if.then ], [ %sub, %entry ] 270 ret i32 %hasflag 271} 272 273define i32 @macrofuse_dec_je(i32 %flags, i8* %p) nounwind { 274; NOFUSION_NOPOSTRA-LABEL: macrofuse_dec_je: 275; NOFUSION_NOPOSTRA: # %bb.0: # %entry 276; NOFUSION_NOPOSTRA-NEXT: movl %edi, %eax 277; NOFUSION_NOPOSTRA-NEXT: decl %eax 278; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 279; NOFUSION_NOPOSTRA-NEXT: je .LBB3_2 280; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 281; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax 282; NOFUSION_NOPOSTRA-NEXT: .LBB3_2: # %if.end 283; NOFUSION_NOPOSTRA-NEXT: retq 284; 285; BRANCHFUSIONONLY_NOPOSTRA-LABEL: macrofuse_dec_je: 286; BRANCHFUSIONONLY_NOPOSTRA: # %bb.0: # %entry 287; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl %edi, %eax 288; BRANCHFUSIONONLY_NOPOSTRA-NEXT: decl %eax 289; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movb $1, (%rsi) 290; BRANCHFUSIONONLY_NOPOSTRA-NEXT: je .LBB3_2 291; BRANCHFUSIONONLY_NOPOSTRA-NEXT: # %bb.1: # %if.then 292; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl $1, %eax 293; BRANCHFUSIONONLY_NOPOSTRA-NEXT: .LBB3_2: # %if.end 294; BRANCHFUSIONONLY_NOPOSTRA-NEXT: retq 295; 296; MACROFUSION_NOPOSTRA-LABEL: macrofuse_dec_je: 297; MACROFUSION_NOPOSTRA: # %bb.0: # %entry 298; MACROFUSION_NOPOSTRA-NEXT: movl %edi, %eax 299; MACROFUSION_NOPOSTRA-NEXT: movb $1, (%rsi) 300; MACROFUSION_NOPOSTRA-NEXT: decl %eax 301; MACROFUSION_NOPOSTRA-NEXT: je .LBB3_2 302; MACROFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then 303; MACROFUSION_NOPOSTRA-NEXT: movl $1, %eax 304; MACROFUSION_NOPOSTRA-NEXT: .LBB3_2: # %if.end 305; MACROFUSION_NOPOSTRA-NEXT: retq 306; 307; NOFUSION_POSTRA-LABEL: macrofuse_dec_je: 308; NOFUSION_POSTRA: # %bb.0: # %entry 309; NOFUSION_POSTRA-NEXT: movl %edi, %eax 310; NOFUSION_POSTRA-NEXT: movb $1, (%rsi) 311; NOFUSION_POSTRA-NEXT: decl %eax 312; NOFUSION_POSTRA-NEXT: je .LBB3_2 313; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then 314; NOFUSION_POSTRA-NEXT: movl $1, %eax 315; NOFUSION_POSTRA-NEXT: .LBB3_2: # %if.end 316; NOFUSION_POSTRA-NEXT: retq 317; 318; BRANCHFUSION_POSTRA-LABEL: macrofuse_dec_je: 319; BRANCHFUSION_POSTRA: # %bb.0: # %entry 320; BRANCHFUSION_POSTRA-NEXT: movl %edi, %eax 321; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi) 322; BRANCHFUSION_POSTRA-NEXT: decl %eax 323; BRANCHFUSION_POSTRA-NEXT: je .LBB3_2 324; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then 325; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax 326; BRANCHFUSION_POSTRA-NEXT: .LBB3_2: # %if.end 327; BRANCHFUSION_POSTRA-NEXT: retq 328; 329; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_dec_je: 330; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 331; NOFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax 332; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 333; NOFUSION_MISCHEDPOSTRA-NEXT: decl %eax 334; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB3_2 335; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 336; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 337; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB3_2: # %if.end 338; NOFUSION_MISCHEDPOSTRA-NEXT: retq 339; 340; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_dec_je: 341; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry 342; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax 343; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi) 344; BRANCHFUSION_MISCHEDPOSTRA-NEXT: decl %eax 345; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB3_2 346; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then 347; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax 348; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB3_2: # %if.end 349; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq 350entry: 351 %sub = sub i32 %flags, 1 352 %tobool = icmp eq i32 %sub, 0 353 store i8 1, i8* %p 354 br i1 %tobool, label %if.end, label %if.then 355 356if.then: 357 br label %if.end 358 359if.end: 360 %hasflag = phi i32 [ 1, %if.then ], [ %sub, %entry ] 361 ret i32 %hasflag 362} 363