[PATCH] D117078: Minor adjustment in order of noundef analysis to be a bit more optimal (when disabled).

Kevin Athey via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 11 19:18:02 PST 2022


kda created this revision.
kda added reviewers: vitalybuka, eugenis.
kda requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117078

Files:
  clang/lib/CodeGen/CGCall.cpp


Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -2377,9 +2377,10 @@
     }
 
     // Decide whether the argument we're handling could be partially undef
-    bool ArgNoUndef = DetermineNoUndef(ParamType, getTypes(), DL, AI);
-    if (CodeGenOpts.EnableNoundefAttrs && ArgNoUndef)
-      Attrs.addAttribute(llvm::Attribute::NoUndef);
+    if (CodeGenOpts.EnableNoundefAttrs) {
+      if (DetermineNoUndef(ParamType, getTypes(), DL, AI))
+        Attrs.addAttribute(llvm::Attribute::NoUndef);
+    }
 
     // 'restrict' -> 'noalias' is done in EmitFunctionProlog when we
     // have the corresponding parameter variable.  It doesn't make


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117078.399176.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220112/9d45f62b/attachment.bin>


More information about the cfe-commits mailing list