Displaying 16 results from an estimated 16 matches for "replaceinstuseswith".
2010 Mar 03
3
[LLVMdev] folding x * 0 = 0
...o the instcombine pass. We'd need IR enhancements to do this sort of thing for real in the mid-level optimizer, some thoughts are here:
> http://nondot.org/sabre/LLVMNotes/FloatingPointChanges.txt
>
Thanks, now it works. I inserted
if (Op1F->isNullValue())
return ReplaceInstUsesWith(I, Op1C); // X * 0 == 0
into llvm::InstCombiner::visitFMul
Why not at first create a compile time option for this so that the
code is already available for special purposes?
-Jochen
2008 Apr 04
2
[LLVMdev] InstCombine Question
...reachable. We do this instead of
inserting
09796 // an unreachable instruction directly because we cannot modify
the
09797 // CFG.
09798 new StoreInst(UndefValue::get(LI.getType()),
09799 Constant::getNullValue(Op->getType()), &LI);
09800 return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
09801 }
09802 }
First, what happens to the StoreInst? It looks like it is not attached
anywhere.
Second, I am seeing this happen in a block that is definitely reachable.
Later on the null GEP is removed because it isInstructionTriviallyDead.
But the un...
2014 Dec 09
2
[LLVMdev] Question on equivalence of pointer types
...// that this code is not reachable. We do this instead of inserting
// an unreachable instruction directly because we cannot modify the
// CFG.
new StoreInst(UndefValue::get(LI.getType()),
Constant::getNullValue(Op->getType()), &LI);
return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
}
}
>
> Thanks,
> -- Sanjoy
>
> On Thu, Dec 4, 2014 at 10:09 PM, Sanjoy Das
> <sanjoy at playingwithpointers.com> wrote:
>> Is copy.0 semantically equivalent to copy.1 in the following example?
>>
>> define void...
2010 Mar 03
2
[LLVMdev] folding x * 0 = 0
> You should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options.
Good hint, but
llvm::UnsafeFPMath = true;
llvm::FiniteOnlyFPMathOption = true;
at the beginning of my code does not help.
I found llvm::Reassociate::OptimizeExpression in
llvm\lib\Transforms\Scalar\Reassociate.cpp
which looks like it does X * 0 = 0 for int, but it does not get called
for
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On Mar 3, 2010, at 10:23 AM, Jochen Wilhelmy wrote:
>
>> You should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options.
>
> Good hint, but
>
> llvm::UnsafeFPMath = true;
> llvm::FiniteOnlyFPMathOption = true;
>
> at the beginning of my code does not help.
> I found llvm::Reassociate::OptimizeExpression in
>
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
...#39;d need IR enhancements to do this sort of thing for real in the mid-level optimizer, some thoughts are here:
>> http://nondot.org/sabre/LLVMNotes/FloatingPointChanges.txt
>>
>
> Thanks, now it works. I inserted
>
> if (Op1F->isNullValue())
> return ReplaceInstUsesWith(I, Op1C); // X * 0 == 0
>
> into llvm::InstCombiner::visitFMul
>
> Why not at first create a compile time option for this so that the
> code is already available for special purposes?
I'm not sure how that would work, but it most likely wouldn't fit with the design of ll...
2016 Mar 25
1
[GSOC] Potential Project Ideas
Hello,
My name is Siddharth. I’m a student studying math and computer science at the University of Toronto.
I’m interested in learning more about the LLVM compiler through GSoC. I have no prior experience with LLVM, but I have a strong interest in compilers, and I look forward to learning more.
I would like to pursue one of two potential projects: rewriting bugpoint, and moving optimizations
2008 Apr 04
0
[LLVMdev] InstCombine Question
...> inserting
> 09796 // an unreachable instruction directly because we cannot modify
> the
> 09797 // CFG.
> 09798 new StoreInst(UndefValue::get(LI.getType()),
> 09799 Constant::getNullValue(Op->getType()), &LI);
> 09800 return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType()));
> 09801 }
> 09802 }
>
> First, what happens to the StoreInst? It looks like it is not attached
> anywhere.
The &LI argument causes it to be inserted before the load.
> Second, I am seeing this happen in a block that is definitely re...
2010 Jan 05
0
[LLVMdev] [llvm-commits] [llvm] r92458 - in /llvm/trunk: lib/Target/README.txt lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/or.ll
...ne scrutinizing the logic for
>> correctness.
>>
>> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jan 4 00:03:59 2010
>> @@ -5213,12 +5213,30 @@
>> return ReplaceInstUsesWith(I, B);
>> }
>> }
>> - V1 = 0; V2 = 0; V3 = 0;
>> +
>> + // ((V | N) & C1) | (V & C2) --> (V|N) & (C1|C2)
>> + // iff (C1&C2) == 0 and (N&~C1) == 0
>> + if ((C1->getValue() & C2->getValue...
2014 Dec 05
3
[LLVMdev] Question on equivalence of pointer types
Is copy.0 semantically equivalent to copy.1 in the following example?
define void @copy.0(i8 addrspace(1)* addrspace(1)* %src, i8
addrspace(1)* addrspace(1)* %dst) {
entry:
%val = load i8 addrspace(1)* addrspace(1)* %src
store i8 addrspace(1)* %val, i8 addrspace(1)* addrspace(1)* %dst
ret void
}
define void @copy.1(i8 addrspace(1)* addrspace(1)* %src, i8
addrspace(1)* addrspace(1)* %dst)
2008 Jul 21
2
[LLVMdev] Casting between address spaces and address space semantics
...t as well. We couldn't do this before, because the
+ // above two lines don't hold for the GEPs
+ const Type* GEPTy = PointerType::get(GEP->getType()->getElementType(), DestTy->getAddressSpace());
+ ReplaceWith = InsertBitCastBefore(NewInst, GEPTy, *GEP);
+ }
+ ReplaceInstUsesWith(*OldInst, ReplaceWith);
+ EraseInstFromFunction(*OldInst);
+
+ }
+
+ // Return the old instruction, so it can be removed.
+ return &CI;
+}
+
Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
// If the operands are integer typed then apply the integer transforms,
// o...
2017 Jul 07
3
GEP with a null pointer base
> On Jul 6, 2017, at 3:07 PM, Chris Lattner <clattner at nondot.org> wrote:
>
>
>> On Jul 6, 2017, at 2:05 PM, Peter Lawrence via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>
>>
>>> On Jul 6, 2017, at 1:00 PM, via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>>
2008 Jul 21
0
[LLVMdev] Casting between address spaces and address space semantics
...re,
> because the
> + // above two lines don't hold for the GEPs
> + const Type* GEPTy = PointerType::get(GEP->getType()-
> >getElementType(), DestTy->getAddressSpace());
> + ReplaceWith = InsertBitCastBefore(NewInst, GEPTy, *GEP);
> + }
> + ReplaceInstUsesWith(*OldInst, ReplaceWith);
> + EraseInstFromFunction(*OldInst);
> +
> + }
> +
> + // Return the old instruction, so it can be removed.
> + return &CI;
> +}
> +
> Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
> // If the operands are integer ty...
2008 Jul 18
0
[LLVMdev] Casting between address spaces and address space semantics
Hi Eli, Mon Ping,
> In ISO/IEC WG14 n1169 on the C extensions to support embedded
> processors, any two address spaces must be disjoint, must be
> equivalent, or must be nested.
Ah, that standard is a lot clearer on this subject than the DSP-C one I read
was.
> As Eli indicated, the actual relationship is platform specific depending on
> what makes the most sense for
2020 May 06
2
Unexpected behavior found in Stack Coloring pass, need clarification
Hello,
I have come across an unusual behavior where instruction domination rule is
violated "Instruction does not dominate all its uses." It concerns with
StackColoring pass present at llvm/lib/CodeGen/StackColoring.cpp. I am
reaching out to the LLVM community to help me understand the cause of this
issue and the working of the pass.
The IR produced at the end of the pass seems to be
2008 Jul 17
4
[LLVMdev] Casting between address spaces and address space semantics
In ISO/IEC WG14 n1169 on the C extensions to support embedded
processors, any two address spaces must be disjoint, must be
equivalent, or must be nested. As Eli indicated, the actual
relationship is platform specific depending on what makes the most
sense for your hardware and how the program will behave will depend on
that relationship.
-- Mon Ping
On Jul 17, 2008, at 7:25 AM, Eli