Displaying 9 results from an estimated 9 matches for "lhsmask".
2009 Apr 01
2
[LLVMdev] Shuffle combine
Hi all,
I'm having some trouble understanding the following lines in
InstructionCombining.cpp, which possibly contain a bug:
if (Mask[i] >= 2*e)
NewMask.push_back(2*e);
else
NewMask.push_back(LHSMask[Mask[i]]);
When Mask[i] is bigger than the size of LHSMask it reads out of bounds on
that last line. I believe the first line is there to try to prevent that but
then it should be comparing to LHSMask.size() not 2*e (e being Mask.size()).
And when Mask[i] is bigger than the mask size the shuffl...
2009 Apr 01
2
[LLVMdev] Shuffle combine
Hi Stefanus,
Thanks for the info. I still think it's a bug though. Take for example a
case where the vectors each have four elements. The values in Mask[] can
range from 0 to 7, while HLSMask only has 4 elements. So LHSMask[Mask[i]]
can go out of bounds, no?
Cheers,
Nicolas
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Stefanus Du Toit
Sent: woensdag 1 april 2009 16:31
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Shuffle combine
Hi Nicolas,
On...
2009 Apr 02
2
[LLVMdev] Shuffle combine
...VMdev] Shuffle combine
On 1-Apr-09, at 12:42 PM, Nicolas Capens wrote:
Hi Stefanus,
Thanks for the info. I still think it's a bug though. Take for example a
case where the vectors each have four elements. The values in Mask[] can
range from 0 to 7, while HLSMask only has 4 elements. So LHSMask[Mask[i]]
can go out of bounds, no?
Good point! One easy way to fix this would be to use:
if (Mask[i] >= e) {
instead. The code could also be improved to consider the new mask equal to
lhsmask/mask in places where they both refer to undefined elements.
Stefanus
Cheers,
Ni...
2009 Apr 01
0
[LLVMdev] Shuffle combine
On 1-Apr-09, at 12:42 PM, Nicolas Capens wrote:
> Hi Stefanus,
>
> Thanks for the info. I still think it’s a bug though. Take for
> example a case where the vectors each have four elements. The values
> in Mask[] can range from 0 to 7, while HLSMask only has 4 elements.
> So LHSMask[Mask[i]] can go out of bounds, no?
Good point! One easy way to fix this would be to use:
if (Mask[i] >= e) {
instead. The code could also be improved to consider the new mask
equal to lhsmask/mask in places where they both refer to undefined
elements.
Stefanus
> Cheers,
>
> Nic...
2009 Apr 01
0
[LLVMdev] Shuffle combine
Hi Nicolas,
On 1-Apr-09, at 7:34 AM, Nicolas Capens wrote:
> I’m having some trouble understanding the following lines in
> InstructionCombining.cpp, which possibly contain a bug:
>
> if (Mask[i] >= 2*e)
> NewMask.push_back(2*e);
> else
> NewMask.push_back(LHSMask[Mask[i]]);
>
> When Mask[i] is bigger than the size of LHSMask it reads out of
> bounds on that last line. I believe the first line is there to try
> to prevent that but then it should be comparing to LHSMask.size()
> not 2*e (e being Mask.size()).
Upon quick inspection of the...
2009 Apr 03
0
[LLVMdev] Shuffle combine
...On 1-Apr-09, at 12:42 PM, Nicolas Capens wrote:
> Hi Stefanus,
>
> Thanks for the info. I still think it’s a bug though. Take for
> example a case where the vectors each have four elements. The values
> in Mask[] can range from 0 to 7, while HLSMask only has 4 elements.
> So LHSMask[Mask[i]] can go out of bounds, no?
>
> Good point! One easy way to fix this would be to use:
>
> if (Mask[i] >= e) {
>
> instead. The code could also be improved to consider the new mask
> equal to lhsmask/mask in places where they both refer to undefined
> elements....
2010 May 14
2
[LLVMdev] vector optimization
Hi!
Is there a pass that optimizes vector operations?
If I have for examle a sequence of shufflevector instructions
that optimizes them?
(in opencl notation e.g. a.xyzw.wzyx.xxxx -> a.wwww)
-Jochen
2010 May 14
0
[LLVMdev] vector optimization
Instcombine does of this, late codegen also does some of it.
-Chris
On May 14, 2010, at 5:58 AM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:
> Hi!
>
> Is there a pass that optimizes vector operations?
> If I have for examle a sequence of shufflevector instructions
> that optimizes them?
> (in opencl notation e.g. a.xyzw.wzyx.xxxx -> a.wwww)
>
> -Jochen
2007 Mar 30
1
[LLVMdev] Cleanups in ROTL/ROTR DAG combiner code
..., LHSShiftAmt);
else
- Rot = DAG.getNode(ISD::ROTR, VT, LHSShift.getOperand(0),
- RHSShift.getOperand(1));
+ Rot = DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt);
// If there is an AND of either shifted operand, apply it to the result.
if (LHSMask.Val || RHSMask.Val) {
@@ -1532,35 +1533,71 @@
// fold (or (shl x, y), (srl x, (sub 32, y))) -> (rotl x, y)
// fold (or (shl x, y), (srl x, (sub 32, y))) -> (rotr x, (sub 32, y))
- if (RHSShift.getOperand(1).getOpcode() == ISD::SUB &&
- LHSShift.getOperand(1) == RHSShif...