Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SpeculativeExecution: fixed ingoring free execution
Summary: After updating cost model in AMDGPU target (47a5c36) the pass started to ignore some BBs since they got all instructions estimated as free. Reviewers: arsenm, chandlerc, nhaehnle Reviewed By: nhaehnle Subscribers: jvesely, wdng, nhaehnle, tpr, hiraditya, kerbowa, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74825
- Loading branch information
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
llvm/test/CodeGen/AMDGPU/speculative-execution-freecasts.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
; RUN: opt < %s -S -mtriple=amdgcn-unknown-amdhsa -speculative-execution \ | ||
; RUN: -spec-exec-max-speculation-cost 1 -spec-exec-max-not-hoisted 1 \ | ||
; RUN: | FileCheck %s | ||
|
||
; CHECK-LABEL: @ifThen_bitcast( | ||
; CHECK: bitcast | ||
; CHECK: br i1 true | ||
define void @ifThen_bitcast(i32 %y) { | ||
br i1 true, label %a, label %b | ||
|
||
a: | ||
%x = bitcast i32 %y to float | ||
br label %b | ||
|
||
b: | ||
ret void | ||
} | ||
|
||
; CHECK-LABEL: @ifThen_addrspacecast( | ||
; CHECK: addrspacecast | ||
; CHECK: br i1 true | ||
define void @ifThen_addrspacecast(i32* %y) { | ||
br i1 true, label %a, label %b | ||
a: | ||
%x = addrspacecast i32* %y to i32 addrspace(1)* | ||
br label %b | ||
|
||
b: | ||
ret void | ||
} |