[PATCH] D124158: [Clang][Attr] Skip adding noundef attribute to arguments when function has convergent attribute

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 09:41:05 PDT 2022


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:2435
         DetermineNoUndef(ParamType, getTypes(), DL, AI)) {
-      Attrs.addAttribute(llvm::Attribute::NoUndef);
+      if(!FuncAttrs.contains(llvm::Attribute::Convergent))
+        Attrs.addAttribute(llvm::Attribute::NoUndef);
----------------
Missing space before (.
 
Needs comment explaining this


================
Comment at: llvm/test/Transforms/SimplifyCFG/tautological-conditional-branch-convergent-noundef.ll:26
+  %i3 = phi double [%i2, %bb2], [undef, %bb1] 
+  %i4 = call noundef double @two(double %i3, i1 %i1) 
+  ret void
----------------
Aren't the cases with defined handling of undef lanes still defined for the result?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124158/new/

https://reviews.llvm.org/D124158



More information about the llvm-commits mailing list