Displaying 8 results from an estimated 8 matches for "createbinop".
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...ule.getOrInsertFunction("foo", functionType,
nullptr));
llvmFunction->setCallingConv(llvm::CallingConv::C);
llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__",
llvmFunction);
llvm::IRBuilder <> builder(body);
llvm::Value * result =
builder.CreateBinOp(llvm::Instruction::BinaryOps::Add,
llvm::ConstantInt::getSigned(functionType, 40),
llvm::ConstantInt::getSigned(functionType, 2));
builder.CreateRet(result);
llvm::verifyModule(module, llvm::PrintMessageAction);
std::string errorInfo;
llvm::raw_fd_ostream fileStream("test.ll&...
2009 Oct 03
1
[LLVMdev] LLVM-Kaleidoscope tutorial
...tName("x");
Value *y = args++;
y->setName("y");
Value *z = args++;
z->setName("z");
BasicBlock *block = BasicBlock::Create(getGlobalContext(),
"entry", mul_add);
IRBuilder<> builder(block);
Value *tmp = builder.CreateBinOp(Instruction::Mul,
x, y, "tmp");
Value *tmp2 = builder.CreateBinOp(Instruction::Add,
tmp, z, "tmp2");
builder.CreateRet(tmp2);
return mod;
}
__________________________
Remy Demarest
rem...
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...oo", functionType,
> nullptr));
> llvmFunction->setCallingConv(llvm::CallingConv::C);
> llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__",
> llvmFunction);
> llvm::IRBuilder <> builder(body);
> llvm::Value * result =
> builder.CreateBinOp(llvm::Instruction::BinaryOps::Add,
> llvm::ConstantInt::getSigned(functionType, 40),
> llvm::ConstantInt::getSigned(functionType, 2));
> builder.CreateRet(result);
>
> llvm::verifyModule(module, llvm::PrintMessageAction);
>
> std::string errorInfo;
> llvm::raw_...
2016 Jul 21
2
Remove zext-unfolding from InstCombine
...here happens a reverse of the above unfolding, which transforms `logic(cast(A), cast(B))` to `cast(logic(A, B))`:
```
if ((!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src)) &&
shouldOptimizeCast(Cast0) && shouldOptimizeCast(Cast1)) {
Value *NewOp = Builder->CreateBinOp(LogicOpc, Cast0Src, Cast1Src,
I.getName());
return CastInst::Create(CastOpcode, NewOp, DestTy);
}
```
The `(!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src))` part has been added by r48715 in order to ensure that InstCombine does not enter an...
2016 Jul 27
2
Remove zext-unfolding from InstCombine
...the above unfolding, which transforms `logic(cast(A), cast(B))` to `cast(logic(A, B))`:
>
> ```
> if ((!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src)) &&
> shouldOptimizeCast(Cast0) && shouldOptimizeCast(Cast1)) {
> Value *NewOp = Builder->CreateBinOp(LogicOpc, Cast0Src, Cast1Src,
> I.getName());
> return CastInst::Create(CastOpcode, NewOp, DestTy);
> }
> ```
>
> The `(!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src))` part has been added by r48715 in order to ensure that...
2016 Aug 04
2
Remove zext-unfolding from InstCombine
...ich transforms `logic(cast(A), cast(B))` to `cast(logic(A, B))`:
> >
> > ```
> > if ((!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src)) &&
> > shouldOptimizeCast(Cast0) && shouldOptimizeCast(Cast1)) {
> > Value *NewOp = Builder->CreateBinOp(LogicOpc, Cast0Src, Cast1Src,
> > I.getName());
> > return CastInst::Create(CastOpcode, NewOp, DestTy);
> > }
> > ```
> >
> > The `(!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src))` part has been added by r...
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
...nstant *RHS,
+ bool HonorFPExceptions = false) const {
+ return ConstantExpr::getFMul(LHS, RHS, HonorFPExceptions);
}
Constant *CreateUDiv(Constant *LHS, Constant *RHS,
bool isExact = false) const {
@@ -95,8 +97,9 @@ public:
}
Constant *CreateBinOp(Instruction::BinaryOps Opc,
- Constant *LHS, Constant *RHS) const {
- return ConstantExpr::get(Opc, LHS, RHS);
+ Constant *LHS, Constant *RHS,
+ bool HonorFPExceptions = false) const {
+ return ConstantExpr::get(Opc, LHS, RH...