aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-16 20:29:38 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-16 20:29:38 +0000
commit6bd9567a6a1ba62118cdd258ddc52ea8f82ff511 (patch)
treeefa5e78092725455c72491bb166a2ad3aa9648a0 /utils/TableGen/CodeGenTarget.cpp
parent35b9a7790e904abce4e6dac3f1ed89696522f19a (diff)
- Add "Commutative" property to intrinsics. This allows tblgen to generate the commuted variants for dagisel matching code.
- Mark lots of X86 intrinsics as "Commutative" to allow load folding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index a76f5cd55f..9b3864780d 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -404,6 +404,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
std::string DefName = R->getName();
ModRef = WriteMem;
isOverloaded = false;
+ isCommutative = false;
if (DefName.size() <= 4 ||
std::string(DefName.begin(), DefName.begin()+4) != "int_")
@@ -469,6 +470,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
ModRef = WriteArgMem;
else if (Property->getName() == "IntrWriteMem")
ModRef = WriteMem;
+ else if (Property->getName() == "Commutative")
+ isCommutative = true;
else
assert(0 && "Unknown property!");
}