<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Matt,</p>
<p>ok - see <a class="moz-txt-link-freetext" href="https://llvm.org/bugs/show_bug.cgi?id=30630">https://llvm.org/bugs/show_bug.cgi?id=30630</a>.</p>
<p>/Jonas<br>
</p>
<div class="moz-cite-prefix">On 2016-10-06 20:40, Matthew Simpson
wrote:<br>
</div>
<blockquote
cite="mid:CAN5HOijvo0By+3SCgdANARxzLnwrEt-8e-0frS9O_7whEjyzPg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi Jonas,</div>
<div><br>
</div>
<div>It does look like we should be able to simplify this. Would
you mind filing a bug? Looking at the code after InstCombine,
the vector adds are trivially redundant (I think EarlyCSE
should already be able to remove them). I think we could then
teach InstructionSimplify to simplify the remaining shuffles
similar to the way it already handles extracts.</div>
<div><br>
</div>
<div>-- Matt</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Oct 6, 2016 at 10:30 AM, Jonas
Paulsson via llvm-dev <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi,<br>
<br>
I have experimented with enabling the LoopVectorizer for
SystemZ. I have come across a loop which, when vectorized,
seems to have been poorly generated. In short, there seems
to be a completely unnecessary sequence of shufflevector
instructions, that doesn't get optimized away anywhere. In
other words, there is a shuffling so that leads back to the
original vector:<br>
<br>
[0 1 2 3 4 5 6 7]<br>
<br>
[0 4] [1 5] [2 6] [3 7]<br>
<br>
[0 4 1 5] [2 6 3 7]<br>
<br>
[0 1 2 3 4 5 6 7]<br>
<br>
Is this something the instruction combiner, or perhaps the
InterleavedAccess pass should handle? Even though I suspect
that there are currently many target hooks for SystemZ with
bad values returned, this seems like something that the
optimizers should handle regardless. The result of this is
unnecessary target instruction - as can be seen at the
bottom.<br>
<br>
I would appreciate any input on this, and if needed I can
supply a test case.<br>
<br>
/Jonas<br>
<br>
<br>
Loop before vectorize pass:<br>
<br>
while.body320: ; preds =
%while.body320.preheader, %while.body320<br>
%dl.0291 = phi i64* [ %incdec.ptr335, %while.body320 ], [
%73, %while.body320.preheader ]<br>
%ll.0290 = phi i64* [ %incdec.ptr332, %while.body320 ], [
%74, %while.body320.preheader ]<br>
%rl.0289 = phi i64* [ %incdec.ptr333, %while.body320 ], [
%75, %while.body320.preheader ]<br>
%len.0288 = phi i32 [ %dec, %while.body320 ], [ %conv316,
%while.body320.preheader ]<br>
%dec = add nsw i32 %len.0288, -1<br>
%incdec.ptr = getelementptr inbounds i64, i64* %ll.0290,
i64 1<br>
%176 = load i64, i64* %ll.0290, align 8<br>
%incdec.ptr321 = getelementptr inbounds i64, i64*
%rl.0289, i64 1<br>
%177 = load i64, i64* %rl.0289, align 8<br>
%and322 = and i64 %177, %176<br>
%incdec.ptr323 = getelementptr inbounds i64, i64*
%dl.0291, i64 1<br>
store i64 %and322, i64* %dl.0291, align 8<br>
%incdec.ptr324 = getelementptr inbounds i64, i64*
%ll.0290, i64 2<br>
%178 = load i64, i64* %incdec.ptr, align 8<br>
%incdec.ptr325 = getelementptr inbounds i64, i64*
%rl.0289, i64 2<br>
%179 = load i64, i64* %incdec.ptr321, align 8<br>
%and326 = and i64 %179, %178<br>
%incdec.ptr327 = getelementptr inbounds i64, i64*
%dl.0291, i64 2<br>
store i64 %and326, i64* %incdec.ptr323, align 8<br>
%incdec.ptr328 = getelementptr inbounds i64, i64*
%ll.0290, i64 3<br>
%180 = load i64, i64* %incdec.ptr324, align 8<br>
%incdec.ptr329 = getelementptr inbounds i64, i64*
%rl.0289, i64 3<br>
%181 = load i64, i64* %incdec.ptr325, align 8<br>
%and330 = and i64 %181, %180<br>
%incdec.ptr331 = getelementptr inbounds i64, i64*
%dl.0291, i64 3<br>
store i64 %and330, i64* %incdec.ptr327, align 8<br>
%incdec.ptr332 = getelementptr inbounds i64, i64*
%ll.0290, i64 4<br>
%182 = load i64, i64* %incdec.ptr328, align 8<br>
%incdec.ptr333 = getelementptr inbounds i64, i64*
%rl.0289, i64 4<br>
%183 = load i64, i64* %incdec.ptr329, align 8<br>
%and334 = and i64 %183, %182<br>
%incdec.ptr335 = getelementptr inbounds i64, i64*
%dl.0291, i64 4<br>
store i64 %and334, i64* %incdec.ptr331, align 8<br>
%tobool319 = icmp eq i32 %dec, 0<br>
br i1 %tobool319, label %sw.epilog381.loopexit, label
%while.body320<br>
<br>
<br>
Vectorizing:<br>
<br>
LV: Checking a loop in "Perl_do_vop" from do_vop.bc<br>
LV: Loop hints: force=? width=0 unroll=0<br>
LV: Found a loop: while.body320<br>
LV: Found an induction variable.<br>
LV: Found an induction variable.<br>
LV: Found an induction variable.<br>
LV: Found an induction variable.<br>
LV: Did not find one integer induction var.<br>
LV: We can vectorize this loop (with a runtime bound check)!<br>
LV: Analyzing interleaved accesses...<br>
LV: Creating an interleave group with: store i64 %and334,
i64* %incdec.ptr331, align 8<br>
LV: Inserted: store i64 %and330, i64* %incdec.ptr327, align
8<br>
into the interleave group with store i64 %and334, i64*
%incdec.ptr331, align 8<br>
LV: Inserted: store i64 %and326, i64* %incdec.ptr323, align
8<br>
into the interleave group with store i64 %and334, i64*
%incdec.ptr331, align 8<br>
LV: Inserted: store i64 %and322, i64* %dl.0291, align 8<br>
into the interleave group with store i64 %and334, i64*
%incdec.ptr331, align 8<br>
LV: Creating an interleave group with: %183 = load i64,
i64* %incdec.ptr329, align 8<br>
LV: Inserted: %181 = load i64, i64* %incdec.ptr325, align 8<br>
into the interleave group with %183 = load i64, i64*
%incdec.ptr329, align 8<br>
LV: Inserted: %179 = load i64, i64* %incdec.ptr321, align 8<br>
into the interleave group with %183 = load i64, i64*
%incdec.ptr329, align 8<br>
LV: Inserted: %177 = load i64, i64* %rl.0289, align 8<br>
into the interleave group with %183 = load i64, i64*
%incdec.ptr329, align 8<br>
LV: Creating an interleave group with: %182 = load i64,
i64* %incdec.ptr328, align 8<br>
LV: Inserted: %180 = load i64, i64* %incdec.ptr324, align 8<br>
into the interleave group with %182 = load i64, i64*
%incdec.ptr328, align 8<br>
LV: Inserted: %178 = load i64, i64* %incdec.ptr, align 8<br>
into the interleave group with %182 = load i64, i64*
%incdec.ptr328, align 8<br>
LV: Inserted: %176 = load i64, i64* %ll.0290, align 8<br>
into the interleave group with %182 = load i64, i64*
%incdec.ptr328, align 8<br>
LV: Found uniform instruction: %tobool319 = icmp eq i32
%dec, 0<br>
LV: Found uniform instruction: %incdec.ptr324 =
getelementptr inbounds i64, i64* %ll.0290, i64 2<br>
LV: Found uniform instruction: %incdec.ptr329 =
getelementptr inbounds i64, i64* %rl.0289, i64 3<br>
LV: Found uniform instruction: %incdec.ptr323 =
getelementptr inbounds i64, i64* %dl.0291, i64 1<br>
LV: Found uniform instruction: %incdec.ptr328 =
getelementptr inbounds i64, i64* %ll.0290, i64 3<br>
LV: Found uniform instruction: %incdec.ptr321 =
getelementptr inbounds i64, i64* %rl.0289, i64 1<br>
LV: Found uniform instruction: %incdec.ptr327 =
getelementptr inbounds i64, i64* %dl.0291, i64 2<br>
LV: Found uniform instruction: %incdec.ptr325 =
getelementptr inbounds i64, i64* %rl.0289, i64 2<br>
LV: Found uniform instruction: %incdec.ptr331 =
getelementptr inbounds i64, i64* %dl.0291, i64 3<br>
LV: Found uniform instruction: %incdec.ptr = getelementptr
inbounds i64, i64* %ll.0290, i64 1<br>
LV: Found uniform instruction: %dl.0291 = phi i64* [
%incdec.ptr335, %while.body320 ], [ %73,
%while.body320.preheader ]<br>
LV: Found uniform instruction: %incdec.ptr335 =
getelementptr inbounds i64, i64* %dl.0291, i64 4<br>
LV: Found uniform instruction: %ll.0290 = phi i64* [
%incdec.ptr332, %while.body320 ], [ %74,
%while.body320.preheader ]<br>
LV: Found uniform instruction: %incdec.ptr332 =
getelementptr inbounds i64, i64* %ll.0290, i64 4<br>
LV: Found uniform instruction: %rl.0289 = phi i64* [
%incdec.ptr333, %while.body320 ], [ %75,
%while.body320.preheader ]<br>
LV: Found uniform instruction: %incdec.ptr333 =
getelementptr inbounds i64, i64* %rl.0289, i64 4<br>
LV: Found uniform instruction: %len.0288 = phi i32 [ %dec,
%while.body320 ], [ %conv316, %while.body320.preheader ]<br>
LV: Found uniform instruction: %dec = add nsw i32
%len.0288, -1<br>
LV: Found trip count: 0<br>
LV: The Smallest and Widest types: 64 / 64 bits.<br>
LV: The Widest register is: 128 bits.<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%dl.0291 = phi i64* [ %incdec.ptr335, %while.body320 ], [
%73, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%ll.0290 = phi i64* [ %incdec.ptr332, %while.body320 ], [
%74, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%rl.0289 = phi i64* [ %incdec.ptr333, %while.body320 ], [
%75, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%len.0288 = phi i32 [ %dec, %while.body320 ], [ %conv316,
%while.body320.preheader ]<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%dec = add nsw i32 %len.0288, -1<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr = getelementptr inbounds i64, i64* %ll.0290,
i64 1<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%176 = load i64, i64* %ll.0290, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr321 = getelementptr inbounds i64, i64* %rl.0289,
i64 1<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%177 = load i64, i64* %rl.0289, align 8<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%and322 = and i64 %177, %176<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr323 = getelementptr inbounds i64, i64* %dl.0291,
i64 1<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
store i64 %and322, i64* %dl.0291, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr324 = getelementptr inbounds i64, i64* %ll.0290,
i64 2<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%178 = load i64, i64* %incdec.ptr, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr325 = getelementptr inbounds i64, i64* %rl.0289,
i64 2<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%179 = load i64, i64* %incdec.ptr321, align 8<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%and326 = and i64 %179, %178<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr327 = getelementptr inbounds i64, i64* %dl.0291,
i64 2<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
store i64 %and326, i64* %incdec.ptr323, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr328 = getelementptr inbounds i64, i64* %ll.0290,
i64 3<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%180 = load i64, i64* %incdec.ptr324, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr329 = getelementptr inbounds i64, i64* %rl.0289,
i64 3<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%181 = load i64, i64* %incdec.ptr325, align 8<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%and330 = and i64 %181, %180<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr331 = getelementptr inbounds i64, i64* %dl.0291,
i64 3<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
store i64 %and330, i64* %incdec.ptr327, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr332 = getelementptr inbounds i64, i64* %ll.0290,
i64 4<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%182 = load i64, i64* %incdec.ptr328, align 8<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr333 = getelementptr inbounds i64, i64* %rl.0289,
i64 4<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%183 = load i64, i64* %incdec.ptr329, align 8<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%and334 = and i64 %183, %182<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
%incdec.ptr335 = getelementptr inbounds i64, i64* %dl.0291,
i64 4<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
store i64 %and334, i64* %incdec.ptr331, align 8<br>
LV: Found an estimated cost of 1 for VF 1 For instruction:
%tobool319 = icmp eq i32 %dec, 0<br>
LV: Found an estimated cost of 0 for VF 1 For instruction:
br i1 %tobool319, label %sw.epilog381.loopexit, label
%while.body320<br>
LV: Scalar loop costs: 18.<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%dl.0291 = phi i64* [ %incdec.ptr335, %while.body320 ], [
%73, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%ll.0290 = phi i64* [ %incdec.ptr332, %while.body320 ], [
%74, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%rl.0289 = phi i64* [ %incdec.ptr333, %while.body320 ], [
%75, %while.body320.preheader ]<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%len.0288 = phi i32 [ %dec, %while.body320 ], [ %conv316,
%while.body320.preheader ]<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%dec = add nsw i32 %len.0288, -1<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr = getelementptr inbounds i64, i64* %ll.0290,
i64 1<br>
LV: Found an estimated cost of 4 for VF 2 For instruction:
%176 = load i64, i64* %ll.0290, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr321 = getelementptr inbounds i64, i64* %rl.0289,
i64 1<br>
LV: Found an estimated cost of 4 for VF 2 For instruction:
%177 = load i64, i64* %rl.0289, align 8<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%and322 = and i64 %177, %176<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr323 = getelementptr inbounds i64, i64* %dl.0291,
i64 1<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
store i64 %and322, i64* %dl.0291, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr324 = getelementptr inbounds i64, i64* %ll.0290,
i64 2<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%178 = load i64, i64* %incdec.ptr, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr325 = getelementptr inbounds i64, i64* %rl.0289,
i64 2<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%179 = load i64, i64* %incdec.ptr321, align 8<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%and326 = and i64 %179, %178<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr327 = getelementptr inbounds i64, i64* %dl.0291,
i64 2<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
store i64 %and326, i64* %incdec.ptr323, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr328 = getelementptr inbounds i64, i64* %ll.0290,
i64 3<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%180 = load i64, i64* %incdec.ptr324, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr329 = getelementptr inbounds i64, i64* %rl.0289,
i64 3<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%181 = load i64, i64* %incdec.ptr325, align 8<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%and330 = and i64 %181, %180<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr331 = getelementptr inbounds i64, i64* %dl.0291,
i64 3<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
store i64 %and330, i64* %incdec.ptr327, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr332 = getelementptr inbounds i64, i64* %ll.0290,
i64 4<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%182 = load i64, i64* %incdec.ptr328, align 8<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr333 = getelementptr inbounds i64, i64* %rl.0289,
i64 4<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%183 = load i64, i64* %incdec.ptr329, align 8<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%and334 = and i64 %183, %182<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
%incdec.ptr335 = getelementptr inbounds i64, i64* %dl.0291,
i64 4<br>
LV: Found an estimated cost of 4 for VF 2 For instruction:
store i64 %and334, i64* %incdec.ptr331, align 8<br>
LV: Found an estimated cost of 1 for VF 2 For instruction:
%tobool319 = icmp eq i32 %dec, 0<br>
LV: Found an estimated cost of 0 for VF 2 For instruction:
br i1 %tobool319, label %sw.epilog381.loopexit, label
%while.body320<br>
LV: Vector loop of width 2 costs: 9.<br>
LV: Selecting VF: 2.<br>
LV: The target has 32 registers<br>
LV(REG): Calculating max register usage:<br>
LV(REG): At #0 Interval # 0<br>
LV(REG): At #1 Interval # 1<br>
LV(REG): At #2 Interval # 2<br>
LV(REG): At #3 Interval # 3<br>
LV(REG): At #4 Interval # 4<br>
LV(REG): At #5 Interval # 4<br>
LV(REG): At #6 Interval # 5<br>
LV(REG): At #7 Interval # 6<br>
LV(REG): At #8 Interval # 7<br>
LV(REG): At #9 Interval # 8<br>
LV(REG): At #10 Interval # 7<br>
LV(REG): At #12 Interval # 7<br>
LV(REG): At #13 Interval # 8<br>
LV(REG): At #14 Interval # 8<br>
LV(REG): At #15 Interval # 9<br>
LV(REG): At #16 Interval # 9<br>
LV(REG): At #17 Interval # 8<br>
LV(REG): At #19 Interval # 7<br>
LV(REG): At #20 Interval # 8<br>
LV(REG): At #21 Interval # 8<br>
LV(REG): At #22 Interval # 9<br>
LV(REG): At #23 Interval # 9<br>
LV(REG): At #24 Interval # 8<br>
LV(REG): At #26 Interval # 7<br>
LV(REG): At #27 Interval # 7<br>
LV(REG): At #28 Interval # 7<br>
LV(REG): At #29 Interval # 7<br>
LV(REG): At #30 Interval # 7<br>
LV(REG): At #31 Interval # 6<br>
LV(REG): At #33 Interval # 5<br>
LV(REG): VF = 2<br>
LV(REG): Found max usage: 2<br>
LV(REG): Found invariant usage: 4<br>
LV(REG): LoopSize: 35<br>
LV: Loop cost is 18<br>
LV: Interleaving to reduce branch cost.<br>
LV: Interleaving is not beneficial.<br>
LV: Found a vectorizable loop (2) in do_vop.bc<br>
LV: Interleaving disabled by the pass manager<br>
LV: Scalarizing: %dec = add nsw i32 %len.0288, -1<br>
LV: Scalarizing: %incdec.ptr = getelementptr inbounds i64,
i64* %ll.0290, i64 1<br>
LV: Scalarizing: %incdec.ptr321 = getelementptr inbounds
i64, i64* %rl.0289, i64 1<br>
LV: Scalarizing: %incdec.ptr323 = getelementptr inbounds
i64, i64* %dl.0291, i64 1<br>
LV: Scalarizing: %incdec.ptr324 = getelementptr inbounds
i64, i64* %ll.0290, i64 2<br>
LV: Scalarizing: %incdec.ptr325 = getelementptr inbounds
i64, i64* %rl.0289, i64 2<br>
LV: Scalarizing: %incdec.ptr327 = getelementptr inbounds
i64, i64* %dl.0291, i64 2<br>
LV: Scalarizing: %incdec.ptr328 = getelementptr inbounds
i64, i64* %ll.0290, i64 3<br>
LV: Scalarizing: %incdec.ptr329 = getelementptr inbounds
i64, i64* %rl.0289, i64 3<br>
LV: Scalarizing: %incdec.ptr331 = getelementptr inbounds
i64, i64* %dl.0291, i64 3<br>
LV: Scalarizing: %incdec.ptr332 = getelementptr inbounds
i64, i64* %ll.0290, i64 4<br>
LV: Scalarizing: %incdec.ptr333 = getelementptr inbounds
i64, i64* %rl.0289, i64 4<br>
LV: Scalarizing: %incdec.ptr335 = getelementptr inbounds
i64, i64* %dl.0291, i64 4<br>
LV: Scalarizing: %tobool319 = icmp eq i32 %dec, 0<br>
<br>
vectorized loop (vectorization width: 2, interleaved count:
1)<br>
<br>
Loop after vectorize pass:<br>
<br>
vector.body419: ; preds =
%vector.body419, %vector.ph440<br>
%index441 = phi i64 [ 0, %vector.ph440 ], [
%index.next442, %vector.body419 ]<br>
%184 = add i64 %index441, 0<br>
%185 = shl i64 %184, 2<br>
%next.gep453 = getelementptr i64, i64* %73, i64 %185<br>
%186 = add i64 %index441, 0<br>
%187 = shl i64 %186, 2<br>
%next.gep454 = getelementptr i64, i64* %74, i64 %187<br>
%188 = add i64 %index441, 0<br>
%189 = shl i64 %188, 2<br>
%next.gep455 = getelementptr i64, i64* %75, i64 %189<br>
%190 = trunc i64 %index441 to i32<br>
%offset.idx456 = sub i32 %conv316, %190<br>
%broadcast.splatinsert457 = insertelement <2 x i32>
undef, i32 %offset.idx456, i32 0<br>
%broadcast.splat458 = shufflevector <2 x i32>
%broadcast.splatinsert457, <2 x i32> undef, <2 x
i32> zeroinitializer<br>
%induction459 = add <2 x i32> %broadcast.splat458,
<i32 0, i32 -1><br>
%191 = add i32 %offset.idx456, 0<br>
%192 = add nsw i32 %191, -1<br>
%193 = getelementptr inbounds i64, i64* %next.gep454, i64
1<br>
%194 = getelementptr i64, i64* %next.gep454, i32 0<br>
%195 = bitcast i64* %194 to <8 x i64>*<br>
%wide.vec460 = load <8 x i64>, <8 x i64>*
%195, align 8, !alias.scope !21<br>
%strided.vec461 = shufflevector <8 x i64>
%wide.vec460, <8 x i64> undef, <2 x i32> <i32
0, i32 4><br>
%strided.vec462 = shufflevector <8 x i64>
%wide.vec460, <8 x i64> undef, <2 x i32> <i32
1, i32 5><br>
%strided.vec463 = shufflevector <8 x i64>
%wide.vec460, <8 x i64> undef, <2 x i32> <i32
2, i32 6><br>
%strided.vec464 = shufflevector <8 x i64>
%wide.vec460, <8 x i64> undef, <2 x i32> <i32
3, i32 7><br>
%196 = getelementptr inbounds i64, i64* %next.gep455, i64
1<br>
%197 = getelementptr i64, i64* %next.gep455, i32 0<br>
%198 = bitcast i64* %197 to <8 x i64>*<br>
%wide.vec465 = load <8 x i64>, <8 x i64>*
%198, align 8, !alias.scope !24<br>
%strided.vec466 = shufflevector <8 x i64>
%wide.vec465, <8 x i64> undef, <2 x i32> <i32
0, i32 4><br>
%strided.vec467 = shufflevector <8 x i64>
%wide.vec465, <8 x i64> undef, <2 x i32> <i32
1, i32 5><br>
%strided.vec468 = shufflevector <8 x i64>
%wide.vec465, <8 x i64> undef, <2 x i32> <i32
2, i32 6><br>
%strided.vec469 = shufflevector <8 x i64>
%wide.vec465, <8 x i64> undef, <2 x i32> <i32
3, i32 7><br>
%199 = and <2 x i64> %strided.vec466,
%strided.vec461<br>
%200 = getelementptr inbounds i64, i64* %next.gep453, i64
1<br>
%201 = getelementptr inbounds i64, i64* %next.gep454, i64
2<br>
%202 = getelementptr inbounds i64, i64* %next.gep455, i64
2<br>
%203 = and <2 x i64> %strided.vec467,
%strided.vec462<br>
%204 = getelementptr inbounds i64, i64* %next.gep453, i64
2<br>
%205 = getelementptr inbounds i64, i64* %next.gep454, i64
3<br>
%206 = getelementptr inbounds i64, i64* %next.gep455, i64
3<br>
%207 = and <2 x i64> %strided.vec468,
%strided.vec463<br>
%208 = getelementptr inbounds i64, i64* %next.gep453, i64
3<br>
%209 = getelementptr inbounds i64, i64* %next.gep454, i64
4<br>
%210 = getelementptr inbounds i64, i64* %next.gep455, i64
4<br>
%211 = and <2 x i64> %strided.vec469,
%strided.vec464<br>
%212 = getelementptr inbounds i64, i64* %next.gep453, i64
4<br>
%213 = getelementptr i64, i64* %208, i32 -3<br>
%214 = bitcast i64* %213 to <8 x i64>*<br>
%215 = shufflevector <2 x i64> %199, <2 x i64>
%203, <4 x i32> <i32 0, i32 1, i32 2, i32 3><br>
%216 = shufflevector <2 x i64> %207, <2 x i64>
%211, <4 x i32> <i32 0, i32 1, i32 2, i32 3><br>
%217 = shufflevector <4 x i64> %215, <4 x i64>
%216, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4,
i32 5, i32 6, i32 7><br>
%interleaved.vec470 = shufflevector <8 x i64> %217,
<8 x i64> undef, <8 x i32> <i32 0, i32 2, i32
4, i32 6, i32 1, i32 3, i32 5, i32 7><br>
store <8 x i64> %interleaved.vec470, <8 x
i64>* %214, align 8, !alias.scope !26, !noalias !28<br>
%218 = icmp eq i32 %192, 0<br>
%index.next442 = add i64 %index441, 2<br>
%219 = icmp eq i64 %index.next442, %n.vec425<br>
br i1 %219, label %middle.block420, label %vector.body419,
!llvm.loop !29<br>
<br>
Loop after instruction combining:<br>
<br>
vector.body419: ; preds =
%vector.body419, %vector.body419.preheader<br>
%lsr.iv62 = phi i8* [ %scevgep63, %vector.body419 ], [
%dc.2, %vector.body419.preheader ]<br>
%lsr.iv59 = phi i8* [ %scevgep60, %vector.body419 ], [
%cond, %vector.body419.preheader ]<br>
%lsr.iv56 = phi i8* [ %scevgep57, %vector.body419 ], [
%cond57, %vector.body419.preheader ]<br>
%lsr.iv54 = phi i64 [ %lsr.iv.next55, %vector.body419 ], [
%n.vec425, %vector.body419.preheader ]<br>
%lsr.iv6264 = bitcast i8* %lsr.iv62 to <8 x i64>*<br>
%lsr.iv5961 = bitcast i8* %lsr.iv59 to <8 x i64>*<br>
%lsr.iv5658 = bitcast i8* %lsr.iv56 to <8 x i64>*<br>
%wide.vec460 = load <8 x i64>, <8 x i64>*
%lsr.iv5961, align 8, !alias.scope !21<br>
%wide.vec465 = load <8 x i64>, <8 x i64>*
%lsr.iv5658, align 8, !alias.scope !24<br>
%179 = and <8 x i64> %wide.vec465, %wide.vec460<br>
%180 = shufflevector <8 x i64> %179, <8 x i64>
undef, <2 x i32> <i32 0, i32 4><br>
%181 = and <8 x i64> %wide.vec465, %wide.vec460<br>
%182 = shufflevector <8 x i64> %181, <8 x i64>
undef, <2 x i32> <i32 1, i32 5><br>
%183 = and <8 x i64> %wide.vec465, %wide.vec460<br>
%184 = shufflevector <8 x i64> %183, <8 x i64>
undef, <2 x i32> <i32 2, i32 6><br>
%185 = and <8 x i64> %wide.vec465, %wide.vec460<br>
%186 = shufflevector <8 x i64> %185, <8 x i64>
undef, <2 x i32> <i32 3, i32 7><br>
%187 = shufflevector <2 x i64> %180, <2 x i64>
%182, <4 x i32> <i32 0, i32 1, i32 2, i32 3><br>
%188 = shufflevector <2 x i64> %184, <2 x i64>
%186, <4 x i32> <i32 0, i32 1, i32 2, i32 3><br>
%interleaved.vec470 = shufflevector <4 x i64> %187,
<4 x i64> %188, <8 x i32> <i32 0, i32 2, i32
4, i32 6, i32 1, i32 3, i32 5, i32 7><br>
store <8 x i64> %interleaved.vec470, <8 x
i64>* %lsr.iv6264, align 8, !alias.scope !26, !noalias
!28<br>
%lsr.iv.next55 = add i64 %lsr.iv54, -2<br>
%scevgep57 = getelementptr i8, i8* %lsr.iv56, i64 64<br>
%scevgep60 = getelementptr i8, i8* %lsr.iv59, i64 64<br>
%scevgep63 = getelementptr i8, i8* %lsr.iv62, i64 64<br>
%189 = icmp eq i64 %lsr.iv.next55, 0<br>
br i1 %189, label %middle.block420, label %vector.body419,
!llvm.loop !29<br>
<br>
Final vectorized loop<br>
<br>
.LBB0_141: # %vector.body419<br>
# =>This Inner
Loop Header: Depth=1<br>
vl %v0, 48(%r8)<br>
vl %v1, 48(%r7)<br>
vn %v0, %v1, %v0<br>
vl %v1, 16(%r8)<br>
vl %v2, 16(%r7)<br>
vn %v1, %v2, %v1<br>
vmrlg %v2, %v1, %v0<br>
vmrhg %v0, %v1, %v0<br>
vmrlg %v1, %v0, %v2<br>
vst %v1, 48(%r9)<br>
vl %v1, 32(%r8)<br>
vl %v3, 32(%r7)<br>
vn %v1, %v3, %v1<br>
vl %v3, 0(%r8)<br>
vl %v4, 0(%r7)<br>
vn %v3, %v4, %v3<br>
vmrlg %v4, %v3, %v1<br>
vmrhg %v1, %v3, %v1<br>
vmrlg %v3, %v1, %v4<br>
vst %v3, 32(%r9)<br>
vmrhg %v0, %v0, %v2<br>
vst %v0, 16(%r9)<br>
vmrhg %v0, %v1, %v4<br>
vst %v0, 0(%r9)<br>
la %r9, 64(%r9)<br>
la %r8, 64(%r8)<br>
la %r7, 64(%r7)<br>
aghi %r13, -2<br>
jne .LBB0_141<br>
<br>
Final scalar loop :<br>
.LBB0_152: # %while.body320<br>
# =>This Inner
Loop Header: Depth=1<br>
lg %r13, 0(%r14)<br>
ng %r13, 0(%r5)<br>
stg %r13, 0(%r4)<br>
lg %r13, 8(%r14)<br>
ng %r13, 8(%r5)<br>
stg %r13, 8(%r4)<br>
lg %r13, 16(%r14)<br>
ng %r13, 16(%r5)<br>
stg %r13, 16(%r4)<br>
lg %r13, 24(%r14)<br>
ng %r13, 24(%r5)<br>
stg %r13, 24(%r4)<br>
la %r4, 32(%r4)<br>
la %r14, 32(%r14)<br>
la %r5, 32(%r5)<br>
brct %r0, .LBB0_152<br>
j .LBB0_155<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true"
href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>