diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-03-26 23:23:29 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-03-26 23:23:29 +0000 |
commit | 224b19d626b2c8ac81499bb5c4f2d25f49d2d002 (patch) | |
tree | 464deb94b200d154b73b3b4c82aebde537c8a155 /llvm/lib | |
parent | a2c4e4b9295357ec3bbc2f5366c3b41b5bb1b45c (diff) | |
download | bcm5719-llvm-224b19d626b2c8ac81499bb5c4f2d25f49d2d002.tar.gz bcm5719-llvm-224b19d626b2c8ac81499bb5c4f2d25f49d2d002.zip |
[IR] Make Instruction::isAssociative method inline. Add LLVM_READONLY to the static version.
llvm-svn: 298826
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Instruction.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index fc8a0566ab5..8674342a88a 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -545,17 +545,6 @@ bool Instruction::mayThrow() const { return isa<ResumeInst>(this); } -/// Return true if the instruction is associative: -/// -/// Associative operators satisfy: x op (y op z) === (x op y) op z -/// -/// In LLVM, the Add, Mul, And, Or, and Xor operators are associative. -/// -bool Instruction::isAssociative(unsigned Opcode) { - return Opcode == And || Opcode == Or || Opcode == Xor || - Opcode == Add || Opcode == Mul; -} - bool Instruction::isAssociative() const { unsigned Opcode = getOpcode(); if (isAssociative(Opcode)) |