blob: b1d4295fe7311714c03884be01f90e7f05f5a174 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -passes=simplifycfg -mtriple=amdgpu9.0a-amd-amdhsa < %s | FileCheck %s
; Test that SimplifyCFG speculatively executes blocks on AMDGPU even for vector
; types. The AMDGPU getCmpSelInstrCost override returns a low cost for selects,
; allowing the speculation regardless of vector width.
define amdgpu_kernel void @ham(i1 %arg3, i1 %icmp84) {
; CHECK-LABEL: define amdgpu_kernel void @ham(
; CHECK-SAME: i1 [[ARG3:%.*]], i1 [[ICMP84:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[ICMP84]], <4 x float> zeroinitializer, <4 x float> splat (float 1.000000e+00)
; CHECK-NEXT: [[SPEC_SELECT1:%.*]] = select i1 [[ARG3]], <4 x float> [[SPEC_SELECT]], <4 x float> zeroinitializer
; CHECK-NEXT: ret void
;
entry:
br i1 %arg3, label %then, label %merge
then: ; preds = %entry
%icmp841 = icmp sge i32 0, 0
br i1 %icmp84, label %then.if, label %merge
then.if: ; preds = %then
br label %merge
merge: ; preds = %then.if, %then, %entry
%phi92 = phi <4 x float> [ zeroinitializer, %then.if ], [ splat (float 1.000000e+00), %then ], [ zeroinitializer, %entry ]
ret void
}