From ab8c60867b6d27b97961b91bb8c251b18acbf118 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Fri, 5 Apr 2019 21:22:17 +0000 Subject: [PATCH] [globalisel] Allow combiners to query legality llvm-svn: 357820 --- llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h index 734ef30d9d6b4..417aa402f373d 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h @@ -1062,6 +1062,9 @@ class LegalizerInfo { LegalizeActionStep getAction(const MachineInstr &MI, const MachineRegisterInfo &MRI) const; + bool isLegal(const LegalityQuery &Query) const { + return getAction(Query).Action == LegalizeAction::Legal; + } bool isLegal(const MachineInstr &MI, const MachineRegisterInfo &MRI) const; bool isLegalOrCustom(const MachineInstr &MI, const MachineRegisterInfo &MRI) const;