<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 6/8/2017 4:23 AM, Jonas Paulsson via
llvm-commits wrote:<br>
</div>
<blockquote type="cite"
cite="mid:cb082534-f8fc-ed6e-daa9-d816e365f795@linux.vnet.ibm.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p>Hi,</p>
<p>SystemZ has some failing tests relating to llvm.trap (with
EXPENSIVE_CHECKS). See <a class="moz-txt-link-freetext"
href="https://bugs.llvm.org/show_bug.cgi?id=33047"
moz-do-not-send="true">https://bugs.llvm.org/show_bug.cgi?id=33047</a>.</p>
<p>One of the problems is that this function<br>
</p>
<pre wrap="">*** IR Dump After Module Verifier ***
define i32 @f0() {
entry:
tail call void @llvm.trap()
ret i32 0
}
never reaches the ret, but still SystemZTargetLowering::LowerReturn() is called. This results in
BB#0: derived from LLVM BB %entry
Trap
%vreg0<def> = LHI 0; GR32Bit:%vreg0
%R2L<def> = COPY %vreg0; GR32Bit:%vreg0
Return %R2L<imp-use>
, and this fails since Trap is a terminator (<tt><font size="2">non-terminator after terminator instruction).
It seems that the call to LowerReturn() should never have been made, since it is unreachable.
</font></tt></pre>
</blockquote>
<br>
Other targets solve this problem by not marking their "TRAP"
instruction as a terminator. That seems much simpler than
special-casing trap instrinsics in SelectionDAGBuilder.<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>