mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-04 19:17:12 +00:00
InstSimplify: Optimize away pointless comparisons
(X & INT_MIN) ? X & INT_MAX : X into X & INT_MAX (X & INT_MIN) ? X : X & INT_MAX into X (X & INT_MIN) ? X | INT_MIN : X into X (X & INT_MIN) ? X : X | INT_MIN into X | INT_MIN git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -272,6 +272,13 @@ struct is_power2 {
|
||||
inline cst_pred_ty<is_power2> m_Power2() { return cst_pred_ty<is_power2>(); }
|
||||
inline api_pred_ty<is_power2> m_Power2(const APInt *&V) { return V; }
|
||||
|
||||
struct is_maxsignedvalue {
|
||||
bool isValue(const APInt &C) { return C.isMaxSignedValue(); }
|
||||
};
|
||||
|
||||
inline cst_pred_ty<is_maxsignedvalue> m_MaxSignedValue() { return cst_pred_ty<is_maxsignedvalue>(); }
|
||||
inline api_pred_ty<is_maxsignedvalue> m_MaxSignedValue(const APInt *&V) { return V; }
|
||||
|
||||
template <typename Class> struct bind_ty {
|
||||
Class *&VR;
|
||||
bind_ty(Class *&V) : VR(V) {}
|
||||
|
Reference in New Issue
Block a user