<div dir="ltr">Sorry, leaks indeed from <a href="https://github.com/llvm/llvm-project/commit/1e317c3f819c7b42f8b45383438004193d3344d4" target="_blank" style="color:rgb(51,122,183);box-sizing:border-box;text-decoration-line:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px">[RISCV][llvm-mca] Add mca tests for riscv lmul instruments</a><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 12 May 2023 at 16:21, Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</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"><div dir="ltr">The llvm-mca test failures were caused by <a href="https://github.com/llvm/llvm-project/commit/1e317c3f819c7b42f8b45383438004193d3344d4" style="box-sizing:border-box;color:rgb(51,122,183);text-decoration-line:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px" target="_blank">[RISCV][llvm-mca] Add mca tests for riscv lmul instruments</a> and the author already reverted it.<div><span style="box-sizing:border-box;display:inline-block;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:14px;line-height:1;font-family:FontAwesome;color:rgb(51,51,51)"></span><font color="#333333" face="Helvetica Neue, Helvetica, Arial, sans-serif"><span style="font-size:14px"><br clear="all"></span></font><div><div dir="ltr">~Craig</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 12, 2023 at 2:14 PM Vitaly Buka via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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"><div dir="ltr">Probably this leak is from the patch.<br><a href="https://lab.llvm.org/buildbot/#/builders/5/builds/33651" target="_blank">https://lab.llvm.org/buildbot/#/builders/5/builds/33651</a><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 12 May 2023 at 10:34, Philip Reames via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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: Philip Reames<br>
Date: 2023-05-12T10:33:29-07:00<br>
New Revision: 13984608992246e42e66c019f09764650d60af63<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/13984608992246e42e66c019f09764650d60af63" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/13984608992246e42e66c019f09764650d60af63</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/13984608992246e42e66c019f09764650d60af63.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/13984608992246e42e66c019f09764650d60af63.diff</a><br>
<br>
LOG: [RISCVGatherScatterLowering] Minor code cleanup [NFC]<br>
<br>
Use a switch to avoid repeat tests on the opcode, and factor out some common code out of another switch. (Not all branches had both common bits, but the one which didn't left the values unchanged and their starting value is the respective operand - so storing it back is a nop.)<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff --git a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp<br>
index e844e1b11271..0174aa547a1b 100644<br>
--- a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp<br>
+++ b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp<br>
@@ -225,20 +225,24 @@ bool RISCVGatherScatterLowering::matchStridedRecurrence(Value *Index, Loop *L,<br>
if (!BO)<br>
return false;<br>
<br>
- if (BO->getOpcode() != Instruction::Add &&<br>
- BO->getOpcode() != Instruction::Or &&<br>
- BO->getOpcode() != Instruction::Mul &&<br>
- BO->getOpcode() != Instruction::Shl)<br>
- return false;<br>
-<br>
- // Only support shift by constant.<br>
- if (BO->getOpcode() == Instruction::Shl && !isa<Constant>(BO->getOperand(1)))<br>
- return false;<br>
-<br>
- // We need to be able to treat Or as Add.<br>
- if (BO->getOpcode() == Instruction::Or &&<br>
- !haveNoCommonBitsSet(BO->getOperand(0), BO->getOperand(1), *DL))<br>
+ switch (BO->getOpcode()) {<br>
+ default:<br>
return false;<br>
+ case Instruction::Or:<br>
+ // We need to be able to treat Or as Add.<br>
+ if (!haveNoCommonBitsSet(BO->getOperand(0), BO->getOperand(1), *DL))<br>
+ return false;<br>
+ break;<br>
+ case Instruction::Add:<br>
+ break;<br>
+ case Instruction::Shl:<br>
+ // Only support shift by constant.<br>
+ if (!isa<Constant>(BO->getOperand(1)))<br>
+ return false;<br>
+ break;<br>
+ case Instruction::Mul:<br>
+ break;<br>
+ }<br>
<br>
// We should have one operand in the loop and one splat.<br>
Value *OtherOp;<br>
@@ -291,7 +295,6 @@ bool RISCVGatherScatterLowering::matchStridedRecurrence(Value *Index, Loop *L,<br>
Start = SplatOp;<br>
else<br>
Start = Builder.CreateAdd(Start, SplatOp, "start");<br>
- BasePtr->setIncomingValue(StartBlock, Start);<br>
break;<br>
}<br>
case Instruction::Mul: {<br>
@@ -306,8 +309,6 @@ bool RISCVGatherScatterLowering::matchStridedRecurrence(Value *Index, Loop *L,<br>
Stride = SplatOp;<br>
else<br>
Stride = Builder.CreateMul(Stride, SplatOp, "stride");<br>
- Inc->setOperand(StepIndex, Step);<br>
- BasePtr->setIncomingValue(StartBlock, Start);<br>
break;<br>
}<br>
case Instruction::Shl: {<br>
@@ -316,12 +317,12 @@ bool RISCVGatherScatterLowering::matchStridedRecurrence(Value *Index, Loop *L,<br>
Start = Builder.CreateShl(Start, SplatOp, "start");<br>
Step = Builder.CreateShl(Step, SplatOp, "step");<br>
Stride = Builder.CreateShl(Stride, SplatOp, "stride");<br>
- Inc->setOperand(StepIndex, Step);<br>
- BasePtr->setIncomingValue(StartBlock, Start);<br>
break;<br>
}<br>
}<br>
<br>
+ Inc->setOperand(StepIndex, Step);<br>
+ BasePtr->setIncomingValue(StartBlock, Start);<br>
return true;<br>
}<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>
_______________________________________________<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>
</blockquote></div>