search for: arg_siz

Displaying 20 results from an estimated 29 matches for "arg_siz".

Did you mean: arg_size
2010 Jul 14
2
[PATCH] gfxboot: add include and menu include support
...*menu_ptr = NULL, **menu_next = &menu; + unsigned u, top_level = 0; - menu_default = calloc(1, sizeof *menu_default); + if(!strcmp(filename, "~")) { + top_level = 1; + filename = syslinux_config_file(); + gfx_menu.entries = 0; + gfx_menu.label_size = 0; + gfx_menu.arg_size = 0; + menu_ptr = NULL; + menu_next = &menu; + menu_default = calloc(1, sizeof *menu_default); + } - if(!(f = fopen(syslinux_config_file(), "r"))) return 1; + if(!(f = fopen(filename, "r"))) return 1; while((s = fgets(buf, sizeof buf, f))) { chop_lin...
2009 Sep 02
1
[LLVMdev] [PATCH] PR2218
...// MemCpyOpt::pointerIsParameter - returns true iff pointer is a > parameter of > +/// C call instruction. > +bool MemCpyOpt::pointerIsParameter(Value *pointer, CallInst *C, > unsigned &argI) > +{ > + CallSite CS = CallSite::get(C); > + for (argI = 0; argI < CS.arg_size(); ++argI) > > Please make this a static function, it doesn't need "this". Also, > please do something like this in the for loop: > > + for (argI = 0, CS.arg_size(); argI != argE; ++argI) > > > pointerIsParameter returning a bool and the argument # byref...
2009 Sep 02
2
[LLVMdev] [PATCH] PR2218
...> future :( > > This patch is looking like a great improvement. Some comments on > formatting: > > Please pull this out to a helper function: > + CallSite CS = CallSite::get(C); > + > + // Pointer must be a parameter (case 1) > + for (argI = 0; argI < CS.arg_size(); ++argI) > + if (CS.getArgument(argI)->stripPointerCasts() == pointer) > + break; > + > + if (argI == CS.arg_size()) > + return false; > > per http://llvm.org/docs/CodingStandards.html#hl_predicateloops > > > + // Store cannot be volatile (case 2)...
2009 Sep 02
0
[LLVMdev] [PATCH] PR2218
...s to be merged into one file. +/// MemCpyOpt::pointerIsParameter - returns true iff pointer is a parameter of +/// C call instruction. +bool MemCpyOpt::pointerIsParameter(Value *pointer, CallInst *C, unsigned &argI) +{ + CallSite CS = CallSite::get(C); + for (argI = 0; argI < CS.arg_size(); ++argI) Please make this a static function, it doesn't need "this". Also, please do something like this in the for loop: + for (argI = 0, CS.arg_size(); argI != argE; ++argI) pointerIsParameter returning a bool and the argument # byref is somewhat awkward. I think it...
2009 Jul 25
2
[LLVMdev] [PATCH] PR2218
...make it work both > backward (to support GVN) and forward (to support DSE). In the > meantime, enhancing memcpyopt is fine, so long as there are good > testcases (and your patch has them!). > > Nit picky stuff about the patch: > > + for(unsigned argI = 0; argI < CS.arg_size(); ++argI) { > + if(CS.getArgument(argI)->stripPointerCasts() == pointer) > > Please put spaces after if/for. You get this right in some places, > but wrong in others. > > + Value* pointer = L->getPointerOperand(); > > Please use "Value *pointer" st...
2010 Jul 22
2
[LLVMdev] Question about function arguments
...start != end) { Argument * value = (Argument *)start; cout << "\n Argument: << value->getNameStr(); start++; } This piece of code works if 'module' contains the definition of function foo. Otherwise, I just get blanks even though the number returned by arg_size() is two. If foo is just a function being called from 'module', then how do I determine the arguments. -- Thanks, Hemanth -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100722/6851e67d/attachme...
2017 Apr 27
4
-msave-args backend support for x86_64
...6 +1143,36 @@ BuildCFI(MBB, MBBI, DL, MCCFIInstruction::createDefCfaRegister( nullptr, DwarfFramePtr)); } + + if (SaveArgs) { + ArrayRef<MCPhysReg> GPRs = + get64BitArgumentGPRs(Fn->getCallingConv(), STI); + unsigned arg_size = Fn->arg_size(); + unsigned RI = 0; + int64_t SaveSize = 0; + + for (MCPhysReg Reg : GPRs) { + if (++RI > arg_size) + break; + + SaveSize += SlotSize; + +#if 1 + BuildMI(MBB, MBBI, DL, TII.get(X86::PUSH64r)) + .addReg(Reg) +...
2009 Jul 23
0
[LLVMdev] [PATCH] PR2218
...ry needs to be done to memdep to make it work both backward (to support GVN) and forward (to support DSE). In the meantime, enhancing memcpyopt is fine, so long as there are good testcases (and your patch has them!). Nit picky stuff about the patch: + for(unsigned argI = 0; argI < CS.arg_size(); ++argI) { + if(CS.getArgument(argI)->stripPointerCasts() == pointer) Please put spaces after if/for. You get this right in some places, but wrong in others. + Value* pointer = L->getPointerOperand(); Please use "Value *pointer" style throughout. It looks like MemCpy...
2009 Aug 07
0
[LLVMdev] [PATCH] PR2218
...t back to it. I'll try to be better in the future :( This patch is looking like a great improvement. Some comments on formatting: Please pull this out to a helper function: + CallSite CS = CallSite::get(C); + + // Pointer must be a parameter (case 1) + for (argI = 0; argI < CS.arg_size(); ++argI) + if (CS.getArgument(argI)->stripPointerCasts() == pointer) + break; + + if (argI == CS.arg_size()) + return false; per http://llvm.org/docs/CodingStandards.html#hl_predicateloops + // Store cannot be volatile (case 2) and must-alias with our pointer. + if (S-...
2009 Jul 22
2
[LLVMdev] [PATCH] PR2218
Hello, This patch fixes PR2218. However, I'm not pretty sure that this optimization should be in MemCpyOpt. I think that GVN is good place as well. Regards -- Jakub Staszak -------------- next part -------------- A non-text attachment was scrubbed... Name: pr2218.patch Type: application/octet-stream Size: 6146 bytes Desc: not available URL:
2010 Jul 22
0
[LLVMdev] Question about function arguments
...a" and "b" from the LLVM IR. What do you want the names for? They aren't needed to use and manipulate arguments. > This piece of code works if 'module' contains the definition of function > foo. Otherwise, I just get blanks even though the number returned by > arg_size() is two. No names :) Ciao, Duncan.
2006 Dec 04
1
[LLVMdev] # operands < # args
In n transform I'm writing, when I call arg_size() on a variable argument function similar to printf, it returns 1. However when I call getNumOperands() it returns 0. Isn't an argument a type of operand? If so, shouldn't the number of operands be at least as big as the number of arguments? Ryan -- Ryan M. Lefever [http://www.e...
2010 Jul 22
1
[LLVMdev] Question about function arguments
...e LLVM IR. > > What do you want the names for? They aren't needed to use and manipulate > arguments. > > > This piece of code works if 'module' contains the definition of function > > foo. Otherwise, I just get blanks even though the number returned by > > arg_size() is two. > > No names :) > > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > -- Cheers, Hemanth -...
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...nary operator"); } } Value *CallExprAST::Codegen() { // Look up the name in the global module table. Function *CalleeF = TheModule->getFunction(Callee); if (CalleeF == 0) return ErrorV("Unknown function referenced"); // If argument mismatch error. if (CalleeF->arg_size() != Args.size()) return ErrorV("Incorrect # arguments passed"); std::vector<Value*> ArgsV; for (unsigned i = 0, e = Args.size(); i != e; ++i) { ArgsV.push_back(Args[i]->Codegen()); if (ArgsV.back() == 0) return 0; } return Builder.CreateCall(CalleeF, ArgsV...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...Value *CallExprAST::Codegen() { > // Look up the name in the global module table. > Function *CalleeF = TheModule->getFunction(Callee); > if (CalleeF == 0) > return ErrorV("Unknown function referenced"); > > // If argument mismatch error. > if (CalleeF->arg_size() != Args.size()) > return ErrorV("Incorrect # arguments passed"); > > std::vector<Value*> ArgsV; > for (unsigned i = 0, e = Args.size(); i != e; ++i) { > ArgsV.push_back(Args[i]->Codegen()); > if (ArgsV.back() == 0) return 0; > } > > retu...
2016 May 09
4
Some questions about phase ordering in OPT and LLC
Hi, I'm a PhD student doing phase ordering as part of my PhD topic and I would like to ask some questions about LLVM. Executing the following command to see what passes does OPT execute when targeting a SPARC V8 processor: /opt/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-15.10/bin/llvm-as < /dev/null | /opt/clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-15.10/bin/opt -O3 -march=sparc -mcpu=v8
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...// Get the global struct in our caller. //Value* CallerGlobals = ModifyFunctionRecursive(CallingF).first; Value* CallerGlobals = NULL; // <- This should be modified later. // Copy the existing arguments std::vector<Value*> Args; Args.reserve(CS.arg_size()); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); // First, copy regular arguments for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++AI) { Args.push_back(*AI); } // Then, insert the new argument Args.push_b...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...() { >>  // Look up the name in the global module table. >>  Function *CalleeF = TheModule->getFunction(Callee); >>  if (CalleeF == 0) >>    return ErrorV("Unknown function referenced"); >> >>  // If argument mismatch error. >>  if (CalleeF->arg_size() != Args.size()) >>    return ErrorV("Incorrect # arguments passed"); >> >>  std::vector<Value*> ArgsV; >>  for (unsigned i = 0, e = Args.size(); i != e; ++i) { >>    ArgsV.push_back(Args[i]->Codegen()); >>    if (ArgsV.back() == 0) return 0;...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...// Get the global struct in our caller. //Value* CallerGlobals = ModifyFunctionRecursive(CallingF).first; Value* CallerGlobals = NULL; // <- This should be modified later. // Copy the existing arguments std::vector<Value*> Args; Args.reserve(CS.arg_size()); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); // First, copy regular arguments for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++AI) { Args.push_back(*AI); } // Then, insert the new argument Args.push_b...
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James