<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Attributor] Replace noundef value with undef"
href="https://bugs.llvm.org/show_bug.cgi?id=49104">49104</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Attributor] Replace noundef value with undef
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Interprocedural Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zequanwu@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Here is the reduced IR:
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.hash_table = type { %struct.hash_node*, i64, i64, i64 }
%struct.hash_node = type { i64, i8*, i64, i8* }
%union.label = type { %struct.anon }
%struct.anon = type { i32, i32, i64, i64, i64, i64, i8*, i8*, i8*, i8*, i32,
i32, i32 }
@ltab = external dso_local global %struct.hash_table, align 8
define hidden i32 @lookup_label() {
entry:
br label %if.end
if.end: ; preds = %entry
%call = call %union.label* @find_label(i1 false)
ret i32 undef
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #0
define internal %union.label* @find_label(i1 %create) {
entry:
%create.addr = alloca i8, align 1
%frombool = zext i1 %create to i8
store i8 %frombool, i8* %create.addr, align 1
br label %cond.true
cond.true: ; preds = %entry
br label %cond.end
cond.end: ; preds = %cond.true
br i1 undef, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %cond.end
%0 = load i8, i8* %create.addr, align 1, !range !0
%tobool2 = trunc i8 %0 to i1
br i1 %tobool2, label %if.end, label %if.then
if.then: ; preds = %lor.lhs.false,
%cond.end
ret %union.label* undef
if.end: ; preds = %lor.lhs.false
br label %if.then3
if.then3: ; preds = %if.end
%call4 = call i8* @nasm_malloc(i64 11264)
ret %union.label* undef
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #0
define hidden i1 @declare_label() {
entry:
%call = call %union.label* @find_label(i1 true)
store %union.label* %call, %union.label** undef, align 8
ret i1 undef
}
declare hidden i32 @init_labels()
declare i8* @nasm_malloc(i64)
declare dso_local void @init_block()
; Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg)
#1
declare i8** @hash_find()
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8*
noalias nocapture readonly, i64, i1 immarg) #0
attributes #0 = { argmemonly nofree nosync nounwind willreturn }
attributes #1 = { argmemonly nofree nosync nounwind willreturn writeonly }
!0 = !{i8 0, i8 2}
commands:
opt -O2 --attributor-enable=cgscc reduced.ll
Debug dumpping shows:
[Attributor] Delete at least 0 functions and 0 blocks and 0 instructions and 2
uses
Use i1 undef in call fastcc void @find_label(i1 noundef true) instead of i1
true
Use i1 true in br i1 %create, label %if.then3, label %if.then instead of i1
%create</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>