[PATCH] D91633: SpeculativeExecution: Allow speculating more instruction types
Piotr Sobczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 00:47:37 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc173f1b8ebba: SpeculativeExecution: Allow speculating more instruction types (authored by piotr).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91633/new/
https://reviews.llvm.org/D91633
Files:
llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
llvm/test/Transforms/SpeculativeExecution/spec-fp.ll
Index: llvm/test/Transforms/SpeculativeExecution/spec-fp.ll
===================================================================
--- llvm/test/Transforms/SpeculativeExecution/spec-fp.ll
+++ llvm/test/Transforms/SpeculativeExecution/spec-fp.ll
@@ -99,3 +99,46 @@
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
+}
Index: llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
+++ llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
@@ -245,6 +245,9 @@
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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91633.305997.patch
Type: text/x-patch
Size: 1594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/714cf3be/attachment.bin>
More information about the llvm-commits
mailing list