From c5cf6e536598a3b1e30fce616b771d66a071a54c Mon Sep 17 00:00:00 2001 From: Jean-Luc Duprat Date: Mon, 6 May 2013 16:55:50 +0000 Subject: Provide InstCombines for the following 3 cases: A * (1 - (uitofp i1 C)) -> select C, 0, A B * (uitofp i1 C) -> select C, B, 0 select C, 0, A + select C, B, 0 -> select C, B, A These come up in code that has been hand-optimized from a select to a linear blend, on platforms where that may have mattered. We want to undo such changes with the following transform: A*(1 - uitofp i1 C) + B*(uitofp i1 C) -> select C, A, B git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181216 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/PatternMatch.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/llvm/Support') diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 51b66b0dcd..95d9d782ec 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -693,6 +693,12 @@ m_ZExt(const OpTy &Op) { return CastClass_match(Op); } +/// m_UIToFP +template +inline CastClass_match +m_UIToFp(const OpTy &Op) { + return CastClass_match(Op); +} //===----------------------------------------------------------------------===// // Matchers for unary operators -- cgit v1.2.3-18-g5258