1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

SpeculativeExecution: Allow speculating more instruction types

Support more instructions in SpeculativeExecution pass:
- ExtractElement
- InsertElement
- ShuffleVector

Differential Revision: https://reviews.llvm.org/D91633
This commit is contained in:
Piotr Sobczak 2020-11-17 15:38:44 +01:00
parent 564d64a6ed
commit 5a0d2d0e6d
2 changed files with 46 additions and 0 deletions

View File

@ -245,6 +245,9 @@ static unsigned ComputeSpeculationCost(const Instruction *I,
case Instruction::FNeg:
case Instruction::ICmp:
case Instruction::FCmp:
case Instruction::ExtractElement:
case Instruction::InsertElement:
case Instruction::ShuffleVector:
return TTI.getUserCost(I, TargetTransformInfo::TCK_SizeAndLatency);
default:

View File

@ -99,3 +99,46 @@ a:
b:
ret void
}
; CHECK-LABEL: @ifThen_shuffle(
; CHECK: shufflevector
; CHECK: br i1 true
define void @ifThen_shuffle() {
br i1 true, label %a, label %b
a:
%x = shufflevector <2 x float> undef, <2 x float> undef, <2 x i32> zeroinitializer
br label %b
b:
ret void
}
; CHECK-LABEL: @ifThen_extract(
; CHECK: extractelement
; CHECK: br i1 true
define void @ifThen_extract() {
br i1 true, label %a, label %b
a:
%x = extractelement <2 x float> undef, i32 1
br label %b
b:
ret void
}
; CHECK-LABEL: @ifThen_insert(
; CHECK: insertelement
; CHECK: br i1 true
define void @ifThen_insert() {
br i1 true, label %a, label %b
a:
%x = insertelement <2 x float> undef, float undef, i32 1
br label %b
b:
ret void
}