aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2012-04-02 22:10:29 +0000
committerOwen Anderson <resistor@mac.com>2012-04-02 22:10:29 +0000
commit29f60f359b59032108cdabcde91217b6784c4e13 (patch)
treef0cf6d663860ff858955be8e0208910675fd94c8 /include/llvm/Target
parentbe9fe49b179a89a659fe786d64b176d2b360bb4a (diff)
downloadexternal_llvm-29f60f359b59032108cdabcde91217b6784c4e13.zip
external_llvm-29f60f359b59032108cdabcde91217b6784c4e13.tar.gz
external_llvm-29f60f359b59032108cdabcde91217b6784c4e13.tar.bz2
Add predicates for checking whether targets have free FNEG and FABS operations, and prevent the DAGCombiner from turning them into bitwise operations if they do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r--include/llvm/Target/TargetLowering.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 08420ef..153138f 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -1600,6 +1600,18 @@ public:
return false;
}
+ /// isFNegFree - Return true if an fneg operation is free to the point where
+ /// it is never worthwhile to replace it with a bitwise operation.
+ virtual bool isFNegFree(EVT) const {
+ return false;
+ }
+
+ /// isFAbsFree - Return true if an fneg operation is free to the point where
+ /// it is never worthwhile to replace it with a bitwise operation.
+ virtual bool isFAbsFree(EVT) const {
+ return false;
+ }
+
/// isNarrowingProfitable - Return true if it's profitable to narrow
/// operations of type VT1 to VT2. e.g. on x86, it's profitable to narrow
/// from i32 to i8 but not from i32 to i16.