search for: constantfoldconstantexpression

Displaying 9 results from an estimated 9 matches for "constantfoldconstantexpression".

2013 Sep 26
1
[LLVMdev] Is ConstantFoldConstantExpression meant to be idempotent?
I noticed a change in LLVM's behavior between 3.2 and 3.3/ToT, but I'm not sure if it qualifies as a bug/regression or not. The change is that in 3.3 and tip of trunk, calling ConstantFoldConstantExpression on i64 and (i64 add (i64 add (i64 ptrtoint (i64* getelementptr (i64* null, i32 1) to i64), i64 ptrtoint (i64* getelementptr (i64* null, i32 1) to i64)), i64 15), i64 -16) produces i64 and (i64 add (i64 ptrtoint (i64* getelementptr (i64* null, i32 1) to i64), i64 23), i64 -16) which, whe...
2011 Feb 15
2
[LLVMdev] How to use ConstantFoldConstantExpression?
...w days ago. A version from the trunk should work for you. Cheers, Nadav -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of ihusar Sent: Tuesday, February 15, 2011 15:52 To: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] How to use ConstantFoldConstantExpression? I forgot to mention, that I use LLVM release 2.8, I did not try it with the latest revision, but I expect that I am rather doing something wrong than using non-implemented functions. On Tue, 15 Feb 2011 14:09:57 +0100, ihusar <ihusar at fit.vutbr.cz> wrote: > Hello, > > i need...
2011 Feb 15
0
[LLVMdev] How to use ConstantFoldConstantExpression?
...ase 2.8, I did not try it with the latest revision, but I expect that I am rather doing something wrong than using non-implemented functions. On Tue, 15 Feb 2011 14:09:57 +0100, ihusar <ihusar at fit.vutbr.cz> wrote: > Hello, > > i need to fold constants, i found that a function ConstantFoldConstantExpression could be used, > however I am not able to make it fold anything. Could you please give me some advice, what I am doing wrong? > > > My code looks something like this: > > //data layout is obtained from clang-generated code for triple arm-none-linux-gnueabi with added v32:32:32 &gt...
2011 Feb 15
3
[LLVMdev] How to use ConstantFoldConstantExpression?
Hello, i need to fold constants, i found that a function ConstantFoldConstantExpression could be used, however I am not able to make it fold anything. Could you please give me some advice, what I am doing wrong? My code looks something like this: //data layout is obtained from clang-generated code for triple arm-none-linux-gnueabi with added v32:32:32 const char* const TARGET_DATA_...
2010 Oct 28
0
[LLVMdev] nested GEP in a static initializer fails
...ut understanding constant > folding in LLVM than in seeing this particular functionality implemented. It could certainly be folded if you happen to have the TargetData for the relevant target architecture at hand. I know there's llvm/Support/TargetFolder.h for use with IRBuilder, which uses ConstantFoldConstantExpression() from llvm/Analysis/ConstantFolding.h. That handles GEPs of null pointers. As for transformation passes, grepping for ConstantFoldConstantExpression tells me that instruction combining (-instcombine) calls this method on all operands of instructions, and -globalopt seems to calls it on initializer...
2010 Oct 28
2
[LLVMdev] nested GEP in a static initializer fails
Hi Nick, On Tue, 26 Oct 2010, Nick Lewycky wrote: > Joel E. Denny wrote: > > Given this LLVM assembly: > > > > @a = global i8* getelementptr (i8* null, i64 mul (i64 ptrtoint (i32* > > getelementptr (i32* null, i32 1) to i64), i64 2)) > > > > llc fails an assertion: > > > > llc: /home/jdenny/llvm-svn/include/llvm/Support/Casting.h:202:
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay, Thanks, I saw this flag and it's definitely should be considered, but it appeared to me to be static characteristic of target platform. I'm not sure how appropriate it would be to change its value from a front-end. It says "Has", while optional flag would rather say "Uses" meaning that implementation cares about floating point exceptions. Regards, Sergey
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
...on *I, const DataLayout *TD = nullptr, - const TargetLibraryInfo *TLI = nullptr); + const TargetLibraryInfo *TLI = nullptr, + bool HonorFPExceptions = false); /// ConstantFoldConstantExpression - Attempt to fold the constant expression /// using the specified DataLayout. If successful, the constant result is /// result is returned, if not, null is returned. Constant *ConstantFoldConstantExpression(const ConstantExpr *CE, const DataLayout *TD =...
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 attribute of the original GEP. FYI, the callstack is #0 CastGEPIndices (Ops=..., ResultTy=0x2fb2850, TD=0x2fc8830, TLI=0x2feb390) at ConstantFolding.cpp:623 #1 0x0000000001892dd1 in llvm::C...