summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-03-26 23:23:29 +0000
committerCraig Topper <craig.topper@gmail.com>2017-03-26 23:23:29 +0000
commit224b19d626b2c8ac81499bb5c4f2d25f49d2d002 (patch)
tree464deb94b200d154b73b3b4c82aebde537c8a155 /llvm/include
parenta2c4e4b9295357ec3bbc2f5366c3b41b5bb1b45c (diff)
downloadbcm5719-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/include')
-rw-r--r--llvm/include/llvm/IR/Instruction.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index c1be9da498d..b0bb81e9de1 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -382,8 +382,11 @@ public:
///
/// In LLVM, the Add, Mul, And, Or, and Xor operators are associative.
///
- bool isAssociative() const;
- static bool isAssociative(unsigned op);
+ bool isAssociative() const LLVM_READONLY;
+ static bool isAssociative(unsigned Opcode) {
+ return Opcode == And || Opcode == Or || Opcode == Xor ||
+ Opcode == Add || Opcode == Mul;
+ }
/// Return true if the instruction is commutative:
///
OpenPOWER on IntegriCloud