[Attributor][FIX] AACallEdges, fix propagation error.
authorKuter Dinel <kuterdinel@gmail.com>
Sun, 12 Sep 2021 23:41:54 +0000 (02:41 +0300)
committerKuter Dinel <kuterdinel@gmail.com>
Mon, 13 Sep 2021 00:45:26 +0000 (03:45 +0300)
This patch fixes a error made in 2cc6f7c8e108. That patch
added a call site position but there was a small error with the way
the presence of a unknown call edge was being propagated from call site
to function. This patch fixes that error. This error was effecting some
AMDGPU tests.

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

index 0f73d19..a6342e2 100644 (file)
@@ -9472,9 +9472,9 @@ struct AACallEdgesFunction : public AACallEdgesImpl {
       auto &CBEdges = A.getAAFor<AACallEdges>(
           *this, IRPosition::callsite_function(CB), DepClassTy::REQUIRED);
       if (CBEdges.hasNonAsmUnknownCallee())
-        setHasUnknownCallee(false, Change);
-      if (CBEdges.hasUnknownCallee())
         setHasUnknownCallee(true, Change);
+      if (CBEdges.hasUnknownCallee())
+        setHasUnknownCallee(false, Change);
 
       for (Function *F : CBEdges.getOptimisticEdges())
         addCalledFunction(F, Change);