[PATCH] D20443: [PowerPC] - Combine loads of v4i8 to loads of i32 followed by bitcast

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 02:29:21 PDT 2016


nemanjai added inline comments.

================
Comment at: lib/Target/PowerPC/PPCISelLowering.cpp:10308-10309
@@ +10307,4 @@
+  SDValue SrcVec = Ext1.getOperand(0);
+  int FirstElem = Ext1.getConstantOperandVal(1);
+  int SecondElem = Ext2.getConstantOperandVal(1);
+  int SubvecIdx;
----------------
amehsan wrote:
> If I am reading everything correctly you need to add some code here, to prevent an assertion. 
> 
> First of all the comment in include/llvm/CodeGen/ISDOpcodes.h above definition of EXTRACT_VECTOR_ELT says that index into the vector might be variable. Implementation of getConstantOperandVal uses a cast<ConstantSDNode> which "causing an assertion failure if it is not really an instance of the right type" according to http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates
Yes, that is a very good point. I forgot to add a check that a node from which I'm extracting a constant is actually a constant node :). Will update the patch now.


Repository:
  rL LLVM

http://reviews.llvm.org/D20443





More information about the llvm-commits mailing list