<div dir="ltr">Was this for the Clang Static Analyzer? Any idea what parts the analyzer couldn't understand?<br><br>I assume it has to assume that function returns might already be non-null (eg: T1B probably isn't "might be null" & dereferencing it wouldn't be a problem? Or is any pointer return "Maybe null" in which case maybe just asserting T1B and T2B are non-null as soon as they're returned might be more suitable/closer to the source of the divergence?)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 3:11 AM Simon Pilgrim via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2020-01-10T11:10:42Z<br>
New Revision: 870f6917936fdb8050be3ca3c67d9259390c4326<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/870f6917936fdb8050be3ca3c67d9259390c4326.diff</a><br>
<br>
LOG: Fix "pointer is null" static analyzer warnings. NFCI.<br>
<br>
Assert that the pointers are non-null before dereferencing them.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp<br>
index b18730d967a3..d0285a7aa377 100644<br>
--- a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp<br>
+++ b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp<br>
@@ -282,6 +282,7 @@ bool HexagonEarlyIfConversion::matchFlowPattern(MachineBasicBlock *B,<br>
   // can fall through into the other, in other words, it will be executed<br>
   // in both cases. We only want to predicate the block that is executed<br>
   // conditionally.<br>
+  assert(TB && FB && "Failed to find triangle control flow blocks");<br>
   unsigned TNP = TB->pred_size(), FNP = FB->pred_size();<br>
   unsigned TNS = TB->succ_size(), FNS = FB->succ_size();<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>