summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-12-12 02:30:29 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-12-12 02:30:29 +0000
commit477b178276921913bc282195723b684c225692e5 (patch)
treec8fe46825c20314d96b88b4061e880894597cef9 /llvm/lib/Target
parent8970390f81c67fb444bb850a8c8eea0b7364fc2a (diff)
downloadbcm5719-llvm-477b178276921913bc282195723b684c225692e5.tar.gz
bcm5719-llvm-477b178276921913bc282195723b684c225692e5.zip
R600/SI: Don't promote f32 select to i32
This is nice for the instruction patterns, but it complicates min / max matching. The select doesn't have the correct type and would require looking through the bitcasts for the real float operands. llvm-svn: 224092
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/R600/SIISelLowering.cpp2
-rw-r--r--llvm/lib/Target/R600/SIInstructions.td5
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/R600/SIISelLowering.cpp b/llvm/lib/Target/R600/SIISelLowering.cpp
index f4acbf44111..e41cad23de2 100644
--- a/llvm/lib/Target/R600/SIISelLowering.cpp
+++ b/llvm/lib/Target/R600/SIISelLowering.cpp
@@ -93,8 +93,6 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
setOperationAction(ISD::STORE, MVT::v2i32, Custom);
setOperationAction(ISD::STORE, MVT::v4i32, Custom);
- setOperationAction(ISD::SELECT, MVT::f32, Promote);
- AddPromotedToType(ISD::SELECT, MVT::f32, MVT::i32);
setOperationAction(ISD::SELECT, MVT::i64, Custom);
setOperationAction(ISD::SELECT, MVT::f64, Promote);
AddPromotedToType(ISD::SELECT, MVT::f64, MVT::i64);
diff --git a/llvm/lib/Target/R600/SIInstructions.td b/llvm/lib/Target/R600/SIInstructions.td
index eb7c98754f1..aeba3518f7b 100644
--- a/llvm/lib/Target/R600/SIInstructions.td
+++ b/llvm/lib/Target/R600/SIInstructions.td
@@ -3184,6 +3184,11 @@ def : Pat <
(V_ALIGNBIT_B32 $a, $a, 8))
>;
+def : Pat <
+ (f32 (select i1:$src2, f32:$src1, f32:$src0)),
+ (V_CNDMASK_B32_e64 $src0, $src1, $src2)
+>;
+
//============================================================================//
// Miscellaneous Optimization Patterns
//============================================================================//
OpenPOWER on IntegriCloud