search for: hasallzeroindices

Displaying 10 results from an estimated 10 matches for "hasallzeroindices".

2015 Feb 22
2
[LLVMdev] Question about shouldMergeGEPs in InstructionCombining
...ure I understand the logic for merging GEPs in InstructionCombining.cpp: static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { // If this GEP has only 0 indices, it is the same pointer as // Src. If Src is not a trivial GEP too, don't combine // the indices. if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && !Src.hasOneUse()) return false; return true; } I have a case where GEP: %arrayidx7 = getelementptr inbounds i32* %arrayidx, i32 %shl6 Src: %arrayidx = getelementptr inbounds [4096 x i32]* @phasor_4096, i32 0, i32 %shl2 GEP.hasAllZeroInd...
2015 Feb 24
2
[LLVMdev] Question about shouldMergeGEPs in InstructionCombining
...uctionCombining.cpp: > > > > static bool shouldMergeGEPs (GEPOperator &GEP, GEPOperator &Src) { > > // If this GEP has only 0 indices, it is the same pointer as > > // Src. If Src is not a trivial GEP too, don't combine > > // the indices. > > if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && > > !Src.hasOneUse()) > > return false; > > return true; > > } > > > > > > > > I have a case where > > GEP: %arrayidx7 = getelementptr inbounds i32* %arrayidx, i32 %shl6 > > Src: %arrayidx =...
2015 Feb 25
2
[LLVMdev] Question about shouldMergeGEPs in InstructionCombining
...> static bool shouldMergeGEPs (GEPOperator &GEP, GEPOperator &Src) > > > { > > > // If this GEP has only 0 indices, it is the same pointer as > > > // Src. If Src is not a trivial GEP too, don't combine > > > // the indices. > > > if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && > > > !Src.hasOneUse()) > > > return false; > > > return true; > > > } > > > > > > > > > > > > I have a case where > > > GEP: %arrayidx7 = getelementptr inbounds i32*...
2015 Mar 12
3
[LLVMdev] Question about shouldMergeGEPs in InstructionCombining
I think it would make sense for (1) and (2). I am not sure if (3) is feasible in instcombine. (I am not too familiar with LoopInfo) For the Octasic's Opus platform, I modified shouldMergeGEPs in our fork to: if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && !Src.hasOneUse()) return false; return Src.hasAllConstantIndices(); // was return false; Following that change, I noticed some performance gain for a few specific tests and no regression at all in our (admittedly limited) benchmarks sui...
2013 Jan 27
2
[LLVMdev] Passing an array to an external function
...new to LLVM, and I am learning how to use LLVM for profiling. I need to pass an array to an external method, and insert a call instruction to the method in the code. After reading a few source files, I've tried using GetElementPtrInst to pass an array, but it fails at llvm::GetElementPtrInst::hasAllZeroIndices() const + 0 std::vector<Value*> Args(1); //Vector with array values SmallVector<Constant*, 2> counts; counts.push_back(ConstantInt::get(Type::getInt32Ty(BB->getContext()),32, false...
2015 Mar 12
2
[LLVMdev] Question about shouldMergeGEPs in InstructionCombining
...nts > FunctionPass Manager > Module Verifier > Debug Info Verifier Bitcode Writer > > > > > > > Mark > > > > > > > > For the Octasic's Opus platform, I modified shouldMergeGEPs in our > fork to: > > > > if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && > !Src.hasOneUse()) > return false; > > > return Src.hasAllConstantIndices(); // was return false; > > > > Following that change, I noticed some performance gain for a few > specific tests and no regression at all i...
2013 Jan 27
0
[LLVMdev] Passing an array to an external function
...arning how to use LLVM for profiling. I need to > pass an array to an external method, and insert a call instruction to the > method in the code. > > After reading a few source files, I've tried using GetElementPtrInst to pass > an array, but it fails at llvm::GetElementPtrInst::hasAllZeroIndices() const > + 0 I'm fairly new to LLVM myself, but I'm not sure why you're using GEP at all, let alone with two indices. Does it work to just pass the array value? If not, try using GEP with a single index of 0. The second index would try to index off of element 1 (the second), and th...
2008 Sep 22
0
[LLVMdev] Overzealous PromoteCastOfAllocation
On Sep 13, 2008, at 1:07 PM, Matthijs Kooijman wrote: > Hi Dan, > >> Changing PromoteCastOfAllocation to not replace aggregate allocas >> with >> non-aggregate allocas if they have GEP users sounds reasonable to me. > This sounds reasonable indeed, but still a bit arbitrary. Haven't > figured out > anything better yet, though. > >> Finding the
2008 Sep 13
3
[LLVMdev] Overzealous PromoteCastOfAllocation
Hi Dan, > Changing PromoteCastOfAllocation to not replace aggregate allocas with > non-aggregate allocas if they have GEP users sounds reasonable to me. This sounds reasonable indeed, but still a bit arbitrary. Haven't figured out anything better yet, though. > Finding the maximum alignment is sometimes still useful though, so > it would be nice to update the alignment field of
2008 Sep 23
3
[LLVMdev] Overzealous PromoteCastOfAllocation
...OtherPtr is a bitcast, if so, remove it. if (BitCastInst *BC = dyn_cast<BitCastInst>(OtherPtr)) OtherPtr = BC->getOperand(0); + // All zero GEPs are effectively casts + if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(OtherPtr)) + if (GEP->hasAllZeroIndices()) + OtherPtr = GEP->getOperand(0); + if (ConstantExpr *BCE = dyn_cast<ConstantExpr>(OtherPtr)) if (BCE->getOpcode() == Instruction::BitCast) OtherPtr = BCE->getOperand(0); -------------- next part -------------- A non-text attachment was s...