aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-03-18 23:51:07 +0000
committerEli Bendersky <eliben@google.com>2014-03-18 23:51:07 +0000
commit2281ef91e6e7da350777bc72c59af14b65ab413e (patch)
tree6150eb4a4e25ffa90e0e7d333398a2ad9f3616fe /llvm/utils/TableGen/CodeGenTarget.cpp
parentf078eff39c48f213903a572a2dc2dabd8c719adc (diff)
downloadllvm-2281ef91e6e7da350777bc72c59af14b65ab413e.zip
llvm-2281ef91e6e7da350777bc72c59af14b65ab413e.tar.gz
llvm-2281ef91e6e7da350777bc72c59af14b65ab413e.tar.bz2
Expose "noduplicate" attribute as a property for intrinsics.
The "noduplicate" function attribute exists to prevent certain optimizations from duplicating calls to the function. This is important on platforms where certain function call duplications are unsafe (for example execution barriers for CUDA and OpenCL). This patch makes it possible to specify intrinsics as "noduplicate" and translates that to the appropriate function attribute. llvm-svn: 204200
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 1f47675..884af4c 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -446,6 +446,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
isCommutative = false;
canThrow = false;
isNoReturn = false;
+ isNoDuplicate = false;
if (DefName.size() <= 4 ||
std::string(DefName.begin(), DefName.begin() + 4) != "int_")
@@ -570,6 +571,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
isCommutative = true;
else if (Property->getName() == "Throws")
canThrow = true;
+ else if (Property->getName() == "IntrNoDuplicate")
+ isNoDuplicate = true;
else if (Property->getName() == "IntrNoReturn")
isNoReturn = true;
else if (Property->isSubClassOf("NoCapture")) {