search for: constantfold

Displaying 20 results from an estimated 201 matches for "constantfold".

Did you mean: constantfolder
2015 Apr 20
2
[LLVMdev] ConstantFolding code owner nomination
Hi, I would like to nominate David Majnemer as the code owner for constant folding: lib/IR/ConstantFold.cpp. He seems to be the most active developer based on the git history. David do you accept? -Tom
2012 Mar 02
4
[LLVMdev] replace hardcoded function names by intrinsics
Hi! in the llvm code there are several places with hardcoded function names for e.g. sin, sinf, sqrt, sqrtf etc., namely ConstantFolding.cpp InlineCost.cpp SelectionDAGBuilder.cpp IntrinsicLowering.cpp TargetLowering.cpp my question is: wouldn't it be beneficial to use intrinsics for this? for example a c/c++ frontend (clang) could translate the function calls to intrinsics and then in a very late step (IntrinsicLowering.c...
2010 Jul 07
2
[LLVMdev] ConstantFold 'undef xor undef'
On Jul 7, 2010, at 5:47 AM, Jianzhou Zhao wrote: >> >> Does this also apply to two different variables? say >> int z x y; >> z = x ^ y; >> If ConstantFoldBinaryInstruction also folds x ^ y into z, should this >> pass (which uses ConstantFold) also initialize x and y with a same >> initial value? Otherwise at runtime z may not be 0. > > I guess my question is what variables can have undef values. In my > understanding, only unini...
2010 Jul 07
0
[LLVMdev] ConstantFold 'undef xor undef'
...at 8:34 PM, Chris Lattner <clattner at apple.com> wrote: >> >> On Jul 6, 2010, at 3:37 PM, Jianzhou Zhao wrote: >> >>> Which semantics is better? I guess both are fine because if we assume >>> these two def's are same, then it is 0 as >>> 'ConstantFoldBinaryInstruction', while if we assume they are different >>> then it is equal to undef. But the second case seems to include the >>> first one. If we let undef xor undef to be undef, later we can use >>> this undef as 0, but also other values w.r.t contexts. Is there...
2012 Jun 29
6
[LLVMdev] ConstantExpr refactoring
...anyway. Bug 10368 [1] tells me that ConstantExpr shouldn't automatically fold, and that this is source of many problems (most notably with traps) and code duplication. However, I'm a bit lost... There seem to be constant folding in many places like ConstantExpr::get*() uses lib/Analysis/ConstantFolding.cpp, that uses lib/VMCore/ConstantFold.cpp InstCombine also has some instruction simplification (duh), but it mostly deal with variables, so it only returns a semantically and simpler equivalent operation, rather than go all the way to fold if both arguments are constants (I guess). So, is the...
2010 Jul 07
2
[LLVMdev] ConstantFold 'undef xor undef'
On Tue, Jul 6, 2010 at 8:34 PM, Chris Lattner <clattner at apple.com> wrote: > > On Jul 6, 2010, at 3:37 PM, Jianzhou Zhao wrote: > >> Which semantics is better? I guess both are fine because if we assume >> these two def's are same, then it is 0 as >> 'ConstantFoldBinaryInstruction', while if we assume they are different >> then it is equal to undef. But the second case seems to include the >> first one. If we let undef xor undef to be undef, later we can use >> this undef as 0, but also other values w.r.t contexts. Is there any >>...
2014 Apr 22
2
[LLVMdev] InstCombine strips the inBounds attribute in GetElementPtr ConstantExpr
I can't upload my program due to confidentiality, but the problem is obvious. At lib/Analysis/ConstantFolding.cpp:646 Constant *C = ConstantExpr::getGetElementPtr(Ops[0], NewIdxs); if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { if (Constant *Folded = ConstantFoldConstantExpression(CE, TD, TLI)) C = Folded; } The generated ConstantExpr C doesn't inherit the inBounds a...
2012 Mar 02
2
[LLVMdev] replace hardcoded function names by intrinsics
Hi, >> in the llvm code there are several places with hardcoded function >> names for e.g. sin, sinf, sqrt, sqrtf etc., namely >> ConstantFolding.cpp >> InlineCost.cpp >> SelectionDAGBuilder.cpp >> IntrinsicLowering.cpp >> TargetLowering.cpp >> >> my question is: wouldn't it be beneficial to use intrinsics for this? >> for example a c/c++ >> frontend (clang) could translate the function...
2010 Jul 06
2
[LLVMdev] ConstantFold 'undef xor undef'
Hi, At line 2292, lib/VMCore/ConstantFold.cpp (llvm2.7 release) Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, Constant *C2) { ... // Handle UndefValue up front. if (isa<UndefValue>(C1) || isa<UndefValue>(C2)) { switch (Opcode) { case Ins...
2010 Jul 07
0
[LLVMdev] ConstantFold 'undef xor undef'
On Jul 6, 2010, at 3:37 PM, Jianzhou Zhao wrote: > Which semantics is better? I guess both are fine because if we assume > these two def's are same, then it is 0 as > 'ConstantFoldBinaryInstruction', while if we assume they are different > then it is equal to undef. But the second case seems to include the > first one. If we let undef xor undef to be undef, later we can use > this undef as 0, but also other values w.r.t contexts. Is there any > reason that Con...
2010 Jul 07
0
[LLVMdev] ConstantFold 'undef xor undef'
On Wed, Jul 7, 2010 at 11:38 AM, Chris Lattner <clattner at apple.com> wrote: > > On Jul 7, 2010, at 5:47 AM, Jianzhou Zhao wrote: > >>> >>> Does this also apply to two different variables? say >>>   int z x y; >>>   z = x ^ y; >>> If ConstantFoldBinaryInstruction also folds x ^ y into z, should this >>> pass (which uses ConstantFold) also initialize x and y with a same >>> initial value? Otherwise at runtime z may not be 0. >> >> I guess my question is what variables can have undef values. In my >> unders...
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
...nable it from front-end (Clang in this case). > > I'm doing this for ARM platform and the flag should be reachable from > all these places in LLVM: > > A - lib/Analysis/ValueTracking.cpp > A - lib/CodeGen/SelectionDAG/SelectionDAG.cpp > A - lib/IR/ConstantFold.cpp > A - lib/Target/ARM/ARMFastISel.cpp > A - lib/Target/ARM/ARMISelLowering.cpp > A - lib/Target/ARM/ARMInstrVFP.td (through predicates) > A - lib/Target/ARM/ARMRegisterInfo.td (through predicates) > > and in Clang: > > A - lib/AST/ExprConst...
2014 Jun 03
8
[PATCH v2 0/4] Constant folding of new Instructions
And another try for constant folding of Instructions for nvc0. Please Review this! Thanks, Tobias Klausmann Tobias Klausmann (4): nvc0/ir: clear subop when folding constant expressions nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions nvc0/ir: Handle OP_BFIND when folding constant expressions nvc0/ir: Handle OP_POPCNT when folding constant expressions
2012 Mar 02
0
[LLVMdev] replace hardcoded function names by intrinsics
On Fri, 02 Mar 2012 13:55:18 +0100 Jochen Wilhelmy <jochen.wilhelmy at googlemail.com> wrote: > Hi! > > in the llvm code there are several places with hardcoded function > names for e.g. sin, sinf, sqrt, sqrtf etc., namely > ConstantFolding.cpp > InlineCost.cpp > SelectionDAGBuilder.cpp > IntrinsicLowering.cpp > TargetLowering.cpp > > my question is: wouldn't it be beneficial to use intrinsics for this? > for example a c/c++ > frontend (clang) could translate the function calls to intrinsics and >...
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
...; > >> I'm doing this for ARM platform and the flag should be reachable from > >> all these places in LLVM: > >> > >> A - lib/Analysis/ValueTracking.cpp > >> A - lib/CodeGen/SelectionDAG/SelectionDAG.cpp > >> A - lib/IR/ConstantFold.cpp > >> A - lib/Target/ARM/ARMFastISel.cpp > >> A - lib/Target/ARM/ARMISelLowering.cpp > >> A - lib/Target/ARM/ARMInstrVFP.td (through predicates) > >> A - lib/Target/ARM/ARMRegisterInfo.td (through predicates) > >> > >> an...
2010 Mar 23
2
[LLVMdev] How to avoid memory leaks
...st*, char const&, std::_Rb_tree_iterator<std::pair<std::pair<llvm::Type const*, char> const, llvm::UndefValue*> >) (in /home/gabi/vgen/Debug/vgen) ==20504==    by 0x8853A3: llvm::UndefValue::get(llvm::Type const*) (in /home/gabi/vgen/Debug/vgen) ==20504==    by 0x927DBA: llvm::ConstantFoldBinaryInstruction(unsigned int, llvm::Constant*, llvm::Constant*) (in /home/gabi/vgen/Debug/vgen) ==20504==    by 0x88BD87: llvm::ConstantExpr::getTy(llvm::Type const*, unsigned int, llvm::Constant*, llvm::Constant*, unsigned int) (in /home/gabi/vgen/Debug/vgen) ==20504==    by 0x423B2E: llvm::Const...
2009 Sep 15
1
[LLVMdev] [llvm-commits] [llvm] r81845 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Assembler/insertextractvalue.ll
Chris Lattner wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=81845&view=rev > Log: > fix PR4963: folding insertvalue would sometimes turn a packed struct into > an unpacked one. About this bug -- it happened because ConstantStruct::get has a default parameter for whether the struct should be packed or not, which defaults to not packed. This is strikingly error prone. We
2015 Mar 25
0
[PATCH] nv50/ir: take postFactor into account when doing peephole optimizations
...--git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 6a4ea4e..dc048e6 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -451,7 +451,9 @@ ConstantFolding::expr(Instruction *i, b->data.f32 = 0.0f; } switch (i->dType) { - case TYPE_F32: res.data.f32 = a->data.f32 * b->data.f32; break; + case TYPE_F32: + res.data.f32 = a->data.f32 * b->data.f32 * exp2f(i->postFactor); + break;...
2011 May 06
0
[LLVMdev] Question about linking llvm-mc when porting a new backend
...vm::Type const*) constin libLLVMScalarOpts.a(GVN.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(BasicAliasAnalysis.cpp.o) SymbolicallyEvaluateGEP(llvm::Constant* const*, unsigned int, llvm::Type const*, llvm::TargetData const*)in libLLVMAnalysis.a(ConstantFolding.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMAnalysis.a(ConstantFolding.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin libLLVMSelectionDAG.a(DAGCombiner.cpp.o) llvm::TargetData::getTypeStoreSize(llvm::Type const*) constin lib...
2011 Apr 17
2
[LLVMdev] Error compiling ConstantProp.cpp
I am using llvm-2.6 and the ConstProp.cpp file is http://llvm.org/docs/doxygen/html/ConstantProp_8cpp_source.html and the exact error message is: llvm[0]: Compiling ConstantProp.cpp for Release build (PIC) /home/tarun/Desktop/compiler/LLVM/llvm-2.6/include/llvm/Analysis/ConstantFolding.h: In member function ‘virtual bool<unnamed>::ConstantPropagation::runOnFunction(llvm::Function&)’: /home/tarun/Desktop/compiler/LLVM/llvm-2.6/include/llvm/Analysis/ConstantFolding.h:32: error: too few arguments to function ‘llvm::Constant* llvm::ConstantFoldInstruction(llvm::Instructi...