llvm.org GIT mirror llvm / release_80 test / CodeGen / X86 / aes-schedule.ll
release_80

Tree @release_80 (Download .tar.gz)

aes-schedule.ll @release_80raw · history · blame

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+aes | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=slm -mattr=+aes | FileCheck %s --check-prefix=CHECK --check-prefix=SLM
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=goldmont -mattr=+aes | FileCheck %s --check-prefix=CHECK --check-prefix=SLM
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,SANDY-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,SANDY-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,HASWELL-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=broadwell -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,BROADWELL-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=broadwell -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,BROADWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,SKYLAKE-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skx -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,SKX-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skx -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,SKX
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=bdver2 -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,BDVER2-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=bdver2 -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,BDVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,BTVER2-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 -mattr=+aes,-avx  | FileCheck %s --check-prefixes=CHECK,ZNVER1-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 -mattr=+aes,-avx2 | FileCheck %s --check-prefixes=CHECK,ZNVER1

define <2 x i64> @test_aesdec(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_aesdec:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aesdec %xmm1, %xmm0 # sched: [7:1.00]
; GENERIC-NEXT:    aesdec (%rdi), %xmm0 # sched: [13:1.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aesdec:
; SLM:       # %bb.0:
; SLM-NEXT:    aesdec %xmm1, %xmm0 # sched: [8:5.00]
; SLM-NEXT:    aesdec (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aesdec:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [7:1.00]
; SANDY-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [13:1.00]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aesdec:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; SANDY-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aesdec:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [7:1.00]
; HASWELL-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [13:1.00]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aesdec:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; HASWELL-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aesdec:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [7:1.00]
; BROADWELL-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [12:1.00]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aesdec:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; BROADWELL-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aesdec:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [4:1.00]
; SKYLAKE-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [10:1.00]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aesdec:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKYLAKE-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aesdec:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [4:1.00]
; SKX-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [10:1.00]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aesdec:
; SKX:       # %bb.0:
; SKX-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKX-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aesdec:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [9:1.00]
; BDVER2-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [14:1.00]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aesdec:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [9:1.00]
; BDVER2-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [14:1.00]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aesdec:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aesdec:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [8:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aesdec:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aesdec %xmm1, %xmm0 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aesdec (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aesdec:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaesdec %xmm1, %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vaesdec (%rdi), %xmm0, %xmm0 # sched: [11:0.50]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a2, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aesdec(<2 x i64> %a0, <2 x i64> %a1)
  %3 = call <2 x i64> @llvm.x86.aesni.aesdec(<2 x i64> %2, <2 x i64> %1)
  ret <2 x i64> %3
}
declare <2 x i64> @llvm.x86.aesni.aesdec(<2 x i64>, <2 x i64>)

define <2 x i64> @test_aesdeclast(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_aesdeclast:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [7:1.00]
; GENERIC-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [13:1.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aesdeclast:
; SLM:       # %bb.0:
; SLM-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [8:5.00]
; SLM-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aesdeclast:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [7:1.00]
; SANDY-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [13:1.00]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aesdeclast:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; SANDY-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aesdeclast:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [7:1.00]
; HASWELL-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [13:1.00]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aesdeclast:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; HASWELL-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aesdeclast:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [7:1.00]
; BROADWELL-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [12:1.00]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aesdeclast:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; BROADWELL-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aesdeclast:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [4:1.00]
; SKYLAKE-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [10:1.00]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aesdeclast:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKYLAKE-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aesdeclast:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [4:1.00]
; SKX-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [10:1.00]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aesdeclast:
; SKX:       # %bb.0:
; SKX-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKX-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aesdeclast:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [9:1.00]
; BDVER2-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [14:1.00]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aesdeclast:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [9:1.00]
; BDVER2-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [14:1.00]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aesdeclast:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aesdeclast:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [8:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aesdeclast:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aesdeclast %xmm1, %xmm0 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aesdeclast (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aesdeclast:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaesdeclast %xmm1, %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vaesdeclast (%rdi), %xmm0, %xmm0 # sched: [11:0.50]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a2, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aesdeclast(<2 x i64> %a0, <2 x i64> %a1)
  %3 = call <2 x i64> @llvm.x86.aesni.aesdeclast(<2 x i64> %2, <2 x i64> %1)
  ret <2 x i64> %3
}
declare <2 x i64> @llvm.x86.aesni.aesdeclast(<2 x i64>, <2 x i64>)

define <2 x i64> @test_aesenc(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_aesenc:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aesenc %xmm1, %xmm0 # sched: [7:1.00]
; GENERIC-NEXT:    aesenc (%rdi), %xmm0 # sched: [13:1.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aesenc:
; SLM:       # %bb.0:
; SLM-NEXT:    aesenc %xmm1, %xmm0 # sched: [8:5.00]
; SLM-NEXT:    aesenc (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aesenc:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [7:1.00]
; SANDY-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [13:1.00]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aesenc:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; SANDY-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aesenc:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [7:1.00]
; HASWELL-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [13:1.00]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aesenc:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; HASWELL-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aesenc:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [7:1.00]
; BROADWELL-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [12:1.00]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aesenc:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; BROADWELL-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aesenc:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [4:1.00]
; SKYLAKE-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [10:1.00]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aesenc:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKYLAKE-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aesenc:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [4:1.00]
; SKX-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [10:1.00]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aesenc:
; SKX:       # %bb.0:
; SKX-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKX-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aesenc:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [9:1.00]
; BDVER2-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [14:1.00]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aesenc:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [9:1.00]
; BDVER2-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [14:1.00]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aesenc:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aesenc:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [8:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aesenc:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aesenc %xmm1, %xmm0 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aesenc (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aesenc:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaesenc %xmm1, %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vaesenc (%rdi), %xmm0, %xmm0 # sched: [11:0.50]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a2, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64> %a0, <2 x i64> %a1)
  %3 = call <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64> %2, <2 x i64> %1)
  ret <2 x i64> %3
}
declare <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64>, <2 x i64>)

define <2 x i64> @test_aesenclast(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_aesenclast:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aesenclast %xmm1, %xmm0 # sched: [7:1.00]
; GENERIC-NEXT:    aesenclast (%rdi), %xmm0 # sched: [13:1.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aesenclast:
; SLM:       # %bb.0:
; SLM-NEXT:    aesenclast %xmm1, %xmm0 # sched: [8:5.00]
; SLM-NEXT:    aesenclast (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aesenclast:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [7:1.00]
; SANDY-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [13:1.00]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aesenclast:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; SANDY-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aesenclast:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [7:1.00]
; HASWELL-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [13:1.00]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aesenclast:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; HASWELL-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [13:1.00]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aesenclast:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [7:1.00]
; BROADWELL-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [12:1.00]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aesenclast:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [7:1.00]
; BROADWELL-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aesenclast:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [4:1.00]
; SKYLAKE-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [10:1.00]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aesenclast:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKYLAKE-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aesenclast:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [4:1.00]
; SKX-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [10:1.00]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aesenclast:
; SKX:       # %bb.0:
; SKX-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [4:1.00]
; SKX-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aesenclast:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [9:1.00]
; BDVER2-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [14:1.00]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aesenclast:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [9:1.00]
; BDVER2-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [14:1.00]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aesenclast:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [3:1.00]
; BTVER2-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [8:1.00]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aesenclast:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
; BTVER2-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [8:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aesenclast:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aesenclast %xmm1, %xmm0 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aesenclast (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aesenclast:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaesenclast %xmm1, %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vaesenclast (%rdi), %xmm0, %xmm0 # sched: [11:0.50]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a2, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aesenclast(<2 x i64> %a0, <2 x i64> %a1)
  %3 = call <2 x i64> @llvm.x86.aesni.aesenclast(<2 x i64> %2, <2 x i64> %1)
  ret <2 x i64> %3
}
declare <2 x i64> @llvm.x86.aesni.aesenclast(<2 x i64>, <2 x i64>)

define <2 x i64> @test_aesimc(<2 x i64> %a0, <2 x i64> *%a1) {
; GENERIC-LABEL: test_aesimc:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aesimc %xmm0, %xmm1 # sched: [12:2.00]
; GENERIC-NEXT:    aesimc (%rdi), %xmm0 # sched: [18:2.00]
; GENERIC-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aesimc:
; SLM:       # %bb.0:
; SLM-NEXT:    aesimc %xmm0, %xmm1 # sched: [8:5.00]
; SLM-NEXT:    aesimc (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    por %xmm1, %xmm0 # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aesimc:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [12:2.00]
; SANDY-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [18:2.00]
; SANDY-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aesimc:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaesimc %xmm0, %xmm0 # sched: [12:2.00]
; SANDY-NEXT:    vaesimc (%rdi), %xmm1 # sched: [18:2.00]
; SANDY-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aesimc:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [14:2.00]
; HASWELL-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [20:2.00]
; HASWELL-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aesimc:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaesimc %xmm0, %xmm0 # sched: [14:2.00]
; HASWELL-NEXT:    vaesimc (%rdi), %xmm1 # sched: [20:2.00]
; HASWELL-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aesimc:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aesimc (%rdi), %xmm1 # sched: [19:2.00]
; BROADWELL-SSE-NEXT:    aesimc %xmm0, %xmm0 # sched: [14:2.00]
; BROADWELL-SSE-NEXT:    por %xmm0, %xmm1 # sched: [1:0.33]
; BROADWELL-SSE-NEXT:    movdqa %xmm1, %xmm0 # sched: [1:0.33]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aesimc:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaesimc (%rdi), %xmm1 # sched: [19:2.00]
; BROADWELL-NEXT:    vaesimc %xmm0, %xmm0 # sched: [14:2.00]
; BROADWELL-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aesimc:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [8:2.00]
; SKYLAKE-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [14:2.00]
; SKYLAKE-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aesimc:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaesimc %xmm0, %xmm0 # sched: [8:2.00]
; SKYLAKE-NEXT:    vaesimc (%rdi), %xmm1 # sched: [14:2.00]
; SKYLAKE-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aesimc:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [8:2.00]
; SKX-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [14:2.00]
; SKX-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aesimc:
; SKX:       # %bb.0:
; SKX-NEXT:    vaesimc %xmm0, %xmm0 # sched: [8:2.00]
; SKX-NEXT:    vaesimc (%rdi), %xmm1 # sched: [14:2.00]
; SKX-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aesimc:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [5:1.00]
; BDVER2-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [10:1.00]
; BDVER2-SSE-NEXT:    por %xmm1, %xmm0 # sched: [2:0.50]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aesimc:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaesimc (%rdi), %xmm1 # sched: [10:1.00]
; BDVER2-NEXT:    vaesimc %xmm0, %xmm0 # sched: [5:1.00]
; BDVER2-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [2:0.50]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aesimc:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [2:1.00]
; BTVER2-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [7:1.00]
; BTVER2-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.50]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aesimc:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaesimc (%rdi), %xmm1 # sched: [7:1.00]
; BTVER2-NEXT:    vaesimc %xmm0, %xmm0 # sched: [2:1.00]
; BTVER2-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.50]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aesimc:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aesimc %xmm0, %xmm1 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aesimc (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.25]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aesimc:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaesimc (%rdi), %xmm1 # sched: [11:0.50]
; ZNVER1-NEXT:    vaesimc %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a1, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aesimc(<2 x i64> %a0)
  %3 = call <2 x i64> @llvm.x86.aesni.aesimc(<2 x i64> %1)
  %4 = or <2 x i64> %2, %3
  ret <2 x i64> %4
}
declare <2 x i64> @llvm.x86.aesni.aesimc(<2 x i64>)

define <2 x i64> @test_aeskeygenassist(<2 x i64> %a0, <2 x i64> *%a1) {
; GENERIC-LABEL: test_aeskeygenassist:
; GENERIC:       # %bb.0:
; GENERIC-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [8:3.67]
; GENERIC-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [8:3.33]
; GENERIC-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_aeskeygenassist:
; SLM:       # %bb.0:
; SLM-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [8:5.00]
; SLM-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [8:5.00]
; SLM-NEXT:    por %xmm1, %xmm0 # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-SSE-LABEL: test_aeskeygenassist:
; SANDY-SSE:       # %bb.0:
; SANDY-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [8:3.67]
; SANDY-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [8:3.33]
; SANDY-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SANDY-SSE-NEXT:    retq # sched: [1:1.00]
;
; SANDY-LABEL: test_aeskeygenassist:
; SANDY:       # %bb.0:
; SANDY-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [8:3.67]
; SANDY-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [8:3.33]
; SANDY-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-SSE-LABEL: test_aeskeygenassist:
; HASWELL-SSE:       # %bb.0:
; HASWELL-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [29:7.00]
; HASWELL-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [34:7.00]
; HASWELL-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; HASWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; HASWELL-LABEL: test_aeskeygenassist:
; HASWELL:       # %bb.0:
; HASWELL-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [29:7.00]
; HASWELL-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [34:7.00]
; HASWELL-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; HASWELL-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-SSE-LABEL: test_aeskeygenassist:
; BROADWELL-SSE:       # %bb.0:
; BROADWELL-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [29:7.00]
; BROADWELL-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [33:7.00]
; BROADWELL-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; BROADWELL-SSE-NEXT:    retq # sched: [7:1.00]
;
; BROADWELL-LABEL: test_aeskeygenassist:
; BROADWELL:       # %bb.0:
; BROADWELL-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [29:7.00]
; BROADWELL-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [33:7.00]
; BROADWELL-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-SSE-LABEL: test_aeskeygenassist:
; SKYLAKE-SSE:       # %bb.0:
; SKYLAKE-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [20:6.00]
; SKYLAKE-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [25:6.00]
; SKYLAKE-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SKYLAKE-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_aeskeygenassist:
; SKYLAKE:       # %bb.0:
; SKYLAKE-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [20:6.00]
; SKYLAKE-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [25:6.00]
; SKYLAKE-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-SSE-LABEL: test_aeskeygenassist:
; SKX-SSE:       # %bb.0:
; SKX-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [20:6.00]
; SKX-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [25:6.00]
; SKX-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.33]
; SKX-SSE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_aeskeygenassist:
; SKX:       # %bb.0:
; SKX-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [20:6.00]
; SKX-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [25:6.00]
; SKX-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.33]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BDVER2-SSE-LABEL: test_aeskeygenassist:
; BDVER2-SSE:       # %bb.0:
; BDVER2-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [5:1.00]
; BDVER2-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [10:1.00]
; BDVER2-SSE-NEXT:    por %xmm1, %xmm0 # sched: [2:0.50]
; BDVER2-SSE-NEXT:    retq # sched: [5:1.00]
;
; BDVER2-LABEL: test_aeskeygenassist:
; BDVER2:       # %bb.0:
; BDVER2-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [10:1.00]
; BDVER2-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [5:1.00]
; BDVER2-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [2:0.50]
; BDVER2-NEXT:    retq # sched: [5:1.00]
;
; BTVER2-SSE-LABEL: test_aeskeygenassist:
; BTVER2-SSE:       # %bb.0:
; BTVER2-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [2:1.00]
; BTVER2-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [7:1.00]
; BTVER2-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.50]
; BTVER2-SSE-NEXT:    retq # sched: [4:1.00]
;
; BTVER2-LABEL: test_aeskeygenassist:
; BTVER2:       # %bb.0:
; BTVER2-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [7:1.00]
; BTVER2-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [2:1.00]
; BTVER2-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.50]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-SSE-LABEL: test_aeskeygenassist:
; ZNVER1-SSE:       # %bb.0:
; ZNVER1-SSE-NEXT:    aeskeygenassist $7, %xmm0, %xmm1 # sched: [4:0.50]
; ZNVER1-SSE-NEXT:    aeskeygenassist $7, (%rdi), %xmm0 # sched: [11:0.50]
; ZNVER1-SSE-NEXT:    por %xmm1, %xmm0 # sched: [1:0.25]
; ZNVER1-SSE-NEXT:    retq # sched: [1:0.50]
;
; ZNVER1-LABEL: test_aeskeygenassist:
; ZNVER1:       # %bb.0:
; ZNVER1-NEXT:    vaeskeygenassist $7, (%rdi), %xmm1 # sched: [11:0.50]
; ZNVER1-NEXT:    vaeskeygenassist $7, %xmm0, %xmm0 # sched: [4:0.50]
; ZNVER1-NEXT:    vpor %xmm1, %xmm0, %xmm0 # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a1, align 16
  %2 = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %a0, i8 7)
  %3 = call <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64> %1, i8 7)
  %4 = or <2 x i64> %2, %3
  ret <2 x i64> %4
}
declare <2 x i64> @llvm.x86.aesni.aeskeygenassist(<2 x i64>, i8)