]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/generic-match-head.c
C++: more location wrapper nodes (PR c++/43064, PR c++/43486)
[thirdparty/gcc.git] / gcc / generic-match-head.c
CommitLineData
2165588a 1/* Preamble and helpers for the autogenerated generic-match.c file.
8e8f6434 2 Copyright (C) 2014-2018 Free Software Foundation, Inc.
2165588a 3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#include "config.h"
21#include "system.h"
22#include "coretypes.h"
9ef16211 23#include "backend.h"
7c29e30e 24#include "target.h"
25#include "rtl.h"
2165588a 26#include "tree.h"
9ef16211 27#include "gimple.h"
9ef16211 28#include "ssa.h"
7c29e30e 29#include "cgraph.h"
b20a8bb4 30#include "fold-const.h"
2165588a 31#include "stor-layout.h"
2165588a 32#include "tree-dfa.h"
33#include "builtins.h"
3a18d05c 34#include "case-cfn-macros.h"
d84622d5 35#include "gimplify.h"
f769c6cf 36#include "optabs-tree.h"
2165588a 37
f1054432 38
8cd9143e 39/* Routine to determine if the types T1 and T2 are effectively
b1306f12 40 the same for GENERIC. If T1 or T2 is not a type, the test
41 applies to their TREE_TYPE. */
2165588a 42
8cd9143e 43static inline bool
44types_match (tree t1, tree t2)
45{
b1306f12 46 if (!TYPE_P (t1))
47 t1 = TREE_TYPE (t1);
48 if (!TYPE_P (t2))
49 t2 = TREE_TYPE (t2);
50
8cd9143e 51 return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2);
52}
53
54/* Return if T has a single use. For GENERIC, we assume this is
55 always true. */
56
57static inline bool
58single_use (tree t ATTRIBUTE_UNUSED)
59{
60 return true;
61}
a153e7b3 62
63/* Return true if math operations should be canonicalized,
64 e.g. sqrt(sqrt(x)) -> pow(x, 0.25). */
65
66static inline bool
67canonicalize_math_p ()
68{
69 return true;
70}
a35ca444 71
72/* Return true if math operations that are beneficial only after
73 vectorization should be canonicalized. */
74
75static inline bool
76canonicalize_math_after_vectorization_p ()
77{
78 return false;
79}
9c2ad52a 80
81/* Return true if successive divisions can be optimized.
82 Defer to GIMPLE opts. */
83
84static inline bool
85optimize_successive_divisions_p (tree, tree)
86{
87 return false;
88}