[llvm] a64e858 - [IR][FIX] Intrinsics - don't apply default willreturn if IntrNoReturn is specified

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 02:30:29 PDT 2020


Author: sstefan1
Date: 2020-10-12T11:29:33+02:00
New Revision: a64e8583dafe0fe407e521d546abc9dfb24ba1b3

URL: https://github.com/llvm/llvm-project/commit/a64e8583dafe0fe407e521d546abc9dfb24ba1b3
DIFF: https://github.com/llvm/llvm-project/commit/a64e8583dafe0fe407e521d546abc9dfb24ba1b3.diff

LOG: [IR][FIX] Intrinsics - don't apply default willreturn if IntrNoReturn is specified

Summary: Since willreturn will soon be added as default attribute, we can end up with both noreturn and willreturn on the same intrinsic. This was exposed by llvm.wasm.throw which has IntrNoReturn.

Reviewers: jdoerfert, arsenm

Differential Revision: https://reviews.llvm.org/D88644

Added: 
    

Modified: 
    llvm/utils/TableGen/CodeGenTarget.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 4d3e9ec9cb84..af5e213724b8 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -786,9 +786,6 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R,
     IS.ParamTypeDefs.push_back(TyEl);
   }
 
-  // Set default properties to true.
-  setDefaultProperties(R, DefaultProperties);
-
   // Parse the intrinsic properties.
   ListInit *PropList = R->getValueAsListInit("IntrProperties");
   for (unsigned i = 0, e = PropList->size(); i != e; ++i) {
@@ -799,6 +796,9 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R,
     setProperty(Property);
   }
 
+  // Set default properties to true.
+  setDefaultProperties(R, DefaultProperties);
+
   // Also record the SDPatternOperator Properties.
   Properties = parseSDPatternOperatorProperties(R);
 
@@ -845,7 +845,7 @@ void CodeGenIntrinsic::setProperty(Record *R) {
   else if (R->getName() == "IntrNoFree")
     isNoFree = true;
   else if (R->getName() == "IntrWillReturn")
-    isWillReturn = true;
+    isWillReturn = !isNoReturn;
   else if (R->getName() == "IntrCold")
     isCold = true;
   else if (R->getName() == "IntrSpeculatable")


        


More information about the llvm-commits mailing list