From dab8b6bb50d1c66b87b2f74d1c46d3051f1ea972 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 12 Jan 2004 23:18:25 +0000 Subject: [PATCH] Implement new Instruction::isRelational method llvm-svn: 10810 --- llvm/lib/VMCore/Instruction.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp index 2e22bc3641ae..6f2480bdde7b 100644 --- a/llvm/lib/VMCore/Instruction.cpp +++ b/llvm/lib/VMCore/Instruction.cpp @@ -148,6 +148,22 @@ bool Instruction::isCommutative(unsigned op) { } } +/// isRelational - Return true if the instruction is a Set* instruction: +/// +bool Instruction::isRelational(unsigned op) { + switch (op) { + case SetEQ: + case SetNE: + case SetLT: + case SetGT: + case SetLE: + case SetGE: + return true; + } + return false; +} + + /// isTrappingInstruction - Return true if the instruction may trap. ///