aboutsummaryrefslogtreecommitdiffstats
path: root/linearize.c
AgeCommit message (Expand)AuthorFilesLines
2021-04-18Merge branches 'fix-phisrc' and 'insert-last-insn' into memops-prepLuc Van Oostenryck1-46/+4
2021-04-10linear: only allocate call instructions when neededLuc Van Oostenryck1-1/+2
2021-03-21let insert_phis() use insert_last_instruction()Luc Van Oostenryck1-4/+3
2021-03-21let insert_select() use insert_last_instruction()Luc Van Oostenryck1-6/+1
2021-03-19move insert_branch() to flow.cLuc Van Oostenryck1-26/+0
2021-03-19let insert_branch() reuse the terminating instructionLuc Van Oostenryck1-10/+6
2021-03-19fold remove_parent() into insert_branch()Luc Van Oostenryck1-6/+1
2021-03-19simplify remove_parent()Luc Van Oostenryck1-2/+0
2021-03-19remove insert_branch() redundant argLuc Van Oostenryck1-1/+2
2021-03-08Merge branch 'uniq-phinode'Luc Van Oostenryck1-9/+5
2021-03-08phi-sources can only have a single user (or none)Luc Van Oostenryck1-9/+5
2021-02-28slice: display the source's size, like for unopsLuc Van Oostenryck1-1/+1
2021-02-28slice: OP_SLICE needs the source's type: make it a kind of unopLuc Van Oostenryck1-2/+3
2021-02-28slice: remove unneeded len from OP_SLICELuc Van Oostenryck1-2/+1
2021-02-21asm-mem: does it output to memory?Luc Van Oostenryck1-0/+1
2021-02-21asm-mem: does it clobber memory?Luc Van Oostenryck1-1/+7
2021-02-21asm: output *memory* operands need their address as *input*Luc Van Oostenryck1-8/+23
2021-02-21asm: factor out add_asm_rule() from add_asm_{in,out}put()Luc Van Oostenryck1-11/+12
2021-01-31fix add_join_conditional() when one of the alternative is VOIDLuc Van Oostenryck1-2/+2
2020-12-29packed: no out-of-bound access of packed bitfieldsLuc Van Oostenryck1-2/+11
2020-12-10move check_access() to late_warnings()Luc Van Oostenryck1-0/+6
2020-11-22symaddr: give a type to OP_SYMADDRLuc Van Oostenryck1-4/+4
2020-11-22Merge branch 'optim-cgoto' into nextLuc Van Oostenryck1-0/+6
2020-11-21add a new instruction for label-as-valueLuc Van Oostenryck1-0/+6
2020-11-19Merge branches 'cleanup-postop' and 'cleanup-linearize'Luc Van Oostenryck1-4/+0
2020-11-17linearize: remove unneeded forward declarationsLuc Van Oostenryck1-4/+0
2020-11-17cfg: add missing REPEAT_CFG_CLEANUPLuc Van Oostenryck1-0/+1
2020-11-11Merge branch 'debug'Luc Van Oostenryck1-0/+18
2020-11-09fix linear_isdigit()'s itypeLuc Van Oostenryck1-0/+1
2020-11-01Merge branch 'typed-cmp'Luc Van Oostenryck1-4/+12
2020-11-01linearize __builtin_isdigit()Luc Van Oostenryck1-0/+22
2020-11-01fix usage count in linearize_fma()Luc Van Oostenryck1-3/+3
2020-11-01fix init_linearized_builtins()Luc Van Oostenryck1-1/+1
2020-11-07add debug helpers: show_insn_bb() & show_insn_entry()Luc Van Oostenryck1-0/+18
2020-11-01eval_insn: give an explicit type to compare's operandsLuc Van Oostenryck1-4/+12
2020-10-27Merge branches 'cleanup-linearize', 'inline-use', 'inline-def', 'pure-call', ...Luc Van Oostenryck1-15/+6
2020-10-25OP_CALL should use the full function typeLuc Van Oostenryck1-2/+0
2020-10-25linearize: OP_INLINE should not use the function symbolLuc Van Oostenryck1-1/+1
2020-10-23cleanup linearize_cond_branch()Luc Van Oostenryck1-12/+5
2020-10-22memops need long offsetsLuc Van Oostenryck1-3/+3
2020-09-07builtin: teach sparse to linearize __builtin_fma()Luc Van Oostenryck1-0/+20
2020-09-07builtin: allow linearization to failLuc Van Oostenryck1-2/+5
2020-09-07add support for a new instruction: OP_FMADDLuc Van Oostenryck1-0/+2
2020-08-06bad-shift: wait dead code elimination to warn about bad shiftsLuc Van Oostenryck1-0/+44
2020-05-21bad-goto: do not linearize if the IR will be invalidLuc Van Oostenryck1-1/+1
2020-03-20teach sparse to linearize __builtin_unreachable()Luc Van Oostenryck1-0/+7
2020-03-20add support for linearization of builtinsLuc Van Oostenryck1-0/+32
2020-03-20add an implicit __builtin_unreachable() for __noreturnLuc Van Oostenryck1-0/+10
2020-03-20add instruction OP_UNREACHLuc Van Oostenryck1-0/+3
2019-09-30Merge branch 'fix-expand-asm' into tipLuc Van Oostenryck1-23/+25
2019-09-30do not linearize invalid expressionLuc Van Oostenryck1-2/+6
2019-09-27asm: fix liveness memory operandLuc Van Oostenryck1-0/+1
2019-09-27asm: linearization of output memory operands is differentLuc Van Oostenryck1-4/+9
2019-09-27asm: keep using struct asm_operand during linearizationLuc Van Oostenryck1-15/+10
2019-09-27asm: use a specific struct for asm operandsLuc Van Oostenryck1-9/+10
2018-12-21remove unused regno()Luc Van Oostenryck1-8/+0
2018-12-19allocate BBs after the guardsLuc Van Oostenryck1-1/+3
2018-12-19remove unused arg in add_branch()Luc Van Oostenryck1-4/+4
2018-09-08fix linearization of non-constant switch-casesLuc Van Oostenryck1-2/+5
2018-09-06Merge branches 'missing-return' and 'fix-logical-phi' into tipLuc Van Oostenryck1-52/+89
2018-09-06fix linearization of nested logical exprLuc Van Oostenryck1-18/+31
2018-09-06fix ordering of phi-node operandLuc Van Oostenryck1-2/+2
2018-09-06return nothing only in void functionsLuc Van Oostenryck1-3/+3
2018-09-06use a temp var for the return type/symbolLuc Van Oostenryck1-1/+2
2018-09-06use UNDEF for missing returnsLuc Van Oostenryck1-0/+8
2018-09-06extract add_return() from linearize_return()Luc Van Oostenryck1-11/+16
2018-09-06the return BB is never terminatedLuc Van Oostenryck1-8/+7
2018-09-06there is always an active BB after linearize_fn_statement()Luc Van Oostenryck1-2/+2
2018-09-06specialize linearize_compound_statement()Luc Van Oostenryck1-10/+16
2018-09-06topasm: top-level asm is specialLuc Van Oostenryck1-2/+6
2018-09-05use a temp var for function's upper-level statementLuc Van Oostenryck1-2/+3
2018-09-01Merge branch 'dead-switch' into tipLuc Van Oostenryck1-5/+6
2018-09-01fix linearization of unreachable switch (with reachable label).Luc Van Oostenryck1-5/+6
2018-08-31Merge branch 'opcode' into tipLuc Van Oostenryck1-6/+2
2018-08-25fix: do not optimize away accesses to volatile bitfieldsLuc Van Oostenryck1-2/+2
2018-08-25add a flag for volatile memopsLuc Van Oostenryck1-0/+2
2018-08-25symaddr: s/insn->symbol/insn->src/Luc Van Oostenryck1-6/+2
2018-08-25Merge branch 'ssa' into tipLuc Van Oostenryck1-0/+45
2018-08-07fix bad indentation in linearize_inc_dec()Luc Van Oostenryck1-1/+1
2018-08-07fix instruction size & type in linearize_inc_dec()Luc Van Oostenryck1-1/+5
2018-08-07put back the bitfield base type into struct access_dataLuc Van Oostenryck1-5/+7
2018-08-07expand linearize_position() into linearize_initializer()Luc Van Oostenryck1-9/+2
2018-08-06limit the mask used for bitfield insertionLuc Van Oostenryck1-1/+2
2018-08-06cast: fix warning position in cast_pseudo()Luc Van Oostenryck1-2/+3
2018-08-06boolean conversion of boolean value is a no-opLuc Van Oostenryck1-0/+2
2018-08-06simplify linearize_logical()Luc Van Oostenryck1-27/+14
2018-08-06expand linearize_conditional() into linearize_logical()Luc Van Oostenryck1-17/+47
2018-08-06fix linearize_conditional() for logical opsLuc Van Oostenryck1-4/+13
2018-08-06conditional branches can't accept arbitrary expressionsLuc Van Oostenryck1-1/+1
2018-08-06protect add_convert_to_bool() against bad types / invalid expressionsLuc Van Oostenryck1-0/+2
2018-07-25Merge branch 'optim-cast' into tipLuc Van Oostenryck1-17/+33
2018-07-25Merge branch 'optim-shift' into tipLuc Van Oostenryck1-0/+19
2018-07-24use "%Le" to display floatsLuc Van Oostenryck1-2/+2
2018-07-23bitfield: extract linearize_bitfield_insert()Luc Van Oostenryck1-11/+19
2018-07-23bitfield: extract linearize_bitfield_extract()Luc Van Oostenryck1-6/+14
2018-07-21big-shift: mark out-of-range OP_{ASR,LSR,SHL} as taintedLuc Van Oostenryck1-0/+19
2018-07-13remove obsolete comment: /* Dummy pseudo allocator */Luc Van Oostenryck1-1/+0
2018-07-13no need to assign ad->type for EXPR_POSLuc Van Oostenryck1-1/+0
2018-07-13remove unused struct access_data::posLuc Van Oostenryck1-4/+0
2018-07-13remove unused finish_address_gen()Luc Van Oostenryck1-10/+0
2018-07-01add insert_phi_node()Luc Van Oostenryck1-0/+36
2018-07-01add PSEUDO_UNDEF & undef_pseudo()Luc Van Oostenryck1-0/+9
2018-06-28bool: remove OP_{AND,OR}_BOOL instructionsLuc Van Oostenryck1-2/+0
2018-06-28bool: generate plain OP_{AND,OR} instead of OP_{AND,OR}_BOOLLuc Van Oostenryck1-1/+1
2018-06-28bool: fix missing boolean context for floatsLuc Van Oostenryck1-2/+7
2018-06-23cast: keep instruction sizes consistentLuc Van Oostenryck1-1/+11
2018-06-23cast: do not try to linearize illegal castsLuc Van Oostenryck1-0/+2
2018-06-23cast: accept null castsLuc Van Oostenryck1-0/+6
2018-06-23cast: specialize integer castsLuc Van Oostenryck1-11/+16
2018-06-23cast: make casts from pointer always size preservingLuc Van Oostenryck1-0/+2
2018-06-23cast: add support for -Wpointer-to-int-castLuc Van Oostenryck1-0/+5
2018-06-23cast: specialize cast from pointersLuc Van Oostenryck1-0/+7
2018-06-23cast: temporary simplify handling cast to/from void*Luc Van Oostenryck1-4/+15
2018-06-23cast: make pointer casts always size preservingLuc Van Oostenryck1-0/+2
2018-06-23cast: specialize casts from unsigned to pointersLuc Van Oostenryck1-1/+21
2018-06-23cast: specialize floats to integer conversionLuc Van Oostenryck1-0/+5
2018-06-23cast: handle NO-OP castsLuc Van Oostenryck1-0/+8
2018-06-23cast: specialize FPCAST into [USF]CVTFLuc Van Oostenryck1-3/+15
2018-06-23cast: prepare finer grained cast instructionsLuc Van Oostenryck1-15/+63
2018-06-22rename add_uniop() to add_unop()Luc Van Oostenryck1-3/+3
2018-06-22add_uniop() should take a type, not an expressionLuc Van Oostenryck1-5/+6
2018-05-26context: __context__(...) expect a constant expressionLuc Van Oostenryck1-5/+1
2018-05-06fix comment about PSEUDO_SYM usageLuc Van Oostenryck1-1/+1
2018-03-18avoid deadborn loads & storesLuc Van Oostenryck1-1/+11
2018-03-18fix-return: remove special case for single returnLuc Van Oostenryck1-6/+0
2018-03-18defer initialization of bb::contextLuc Van Oostenryck1-1/+0
2018-03-18small code reorg of add_store()Luc Van Oostenryck1-8/+9
2018-03-18extract alloc_phisrc() from alloc_phi()Luc Van Oostenryck1-10/+16
2018-03-18show_label: add (and use) show_label()Luc Van Oostenryck1-16/+25
2018-03-01IR: let OP_COMPUTEGOTO use .src instead of .targetLuc Van Oostenryck1-2/+2
2018-03-01IR: remove never-generated instructionsLuc Van Oostenryck1-8/+0
2018-03-01IR: remove now unused OP_LNOP & OP_SNOPLuc Van Oostenryck1-4/+2
2018-02-24move the optimization loop in its own fileLuc Van Oostenryck1-62/+2
2018-02-20ban use of 'true' or 'false'Luc Van Oostenryck1-6/+6
2018-02-20no need for signed & unsigned multiplicationLuc Van Oostenryck1-5/+4
2018-02-17rename base_type() to bitfield_base_type()Luc Van Oostenryck1-5/+5
2018-02-17let struct access_data use a single typeLuc Van Oostenryck1-23/+21
2018-02-17use show_pseudo() for OP_SYMADDR's symbolLuc Van Oostenryck1-16/+3
2018-02-17show_pseudo(): protect against NULL ->symLuc Van Oostenryck1-0/+4
2018-02-08Merge branches 'cse-setfval' and 'extract-eval' into tipLuc Van Oostenryck1-3/+1
2018-01-31remove warning "call with no type"Luc Van Oostenryck1-3/+1
2018-01-08add OP_SETFVALLuc Van Oostenryck1-5/+13
2018-01-07cleanup: make some functions staticLuc Van Oostenryck1-6/+6
2017-12-28fix crash on bad expression in linearize_switch()Luc Van Oostenryck1-0/+2
2017-12-21fix linearize (*fun)()Luc Van Oostenryck1-7/+3
2017-12-21simplify linearize_call_expression()Luc Van Oostenryck1-8/+3
2017-11-18add support of floating-point specific arithmetic opsLuc Van Oostenryck1-4/+15
2017-11-18fix support of floating-point compareLuc Van Oostenryck1-2/+19
2017-11-18fix linearize_inc_dec() with floatsLuc Van Oostenryck1-2/+16
2017-11-17add support for wider type in switch-caseLuc Van Oostenryck1-4/+4
2017-11-16give a type to OP_SWITCHsLuc Van Oostenryck1-2/+3
2017-11-16give a type to OP_SELs, alwaysLuc Van Oostenryck1-1/+1
2017-11-16give a type to OP_PHISOURCEsLuc Van Oostenryck1-9/+7
2017-11-16give a type to all function argumentsLuc Van Oostenryck1-6/+7
2017-11-16fix usage of inlined callsLuc Van Oostenryck1-1/+1
2017-11-16don't output value of anonymous symbol's pointerLuc Van Oostenryck1-2/+2
2017-11-16show OP_PHI without VOIDLuc Van Oostenryck1-0/+2
2017-11-13Merge branch 'dump-ir' into tipLuc Van Oostenryck1-5/+7
2017-11-13dump-ir: activate -fdump-ir=mem2regLuc Van Oostenryck1-0/+2
2017-11-13dump-ir: make it more flexibleLuc Van Oostenryck1-1/+1
2017-11-13dump-ir: rename -fdump-linearize to -fdump-irLuc Van Oostenryck1-1/+1
2017-11-13dump-ir: saner use of fdump_linearizeLuc Van Oostenryck1-4/+1
2017-11-13dump-ir: allow to skip the optimization pass(es)Luc Van Oostenryck1-0/+2
2017-11-12dump-ir: activate/deactive pass 'mem2reg'Luc Van Oostenryck1-1/+2
2017-09-17use a specific struct for asm operandsLuc Van Oostenryck1-38/+4
2017-07-31fix crash with sym->bb_target == NULLLuc Van Oostenryck1-1/+4
2017-07-31fix crash when ep->active is NULLLuc Van Oostenryck1-2/+7
2017-07-31fix ptrlist corruption while killing unreachable BBsLuc Van Oostenryck1-3/+0
2017-05-19Merge branches 'dump-macros-v2', 'fix-predefined-size', 'fix-bool-context', '...v0.5.1-rc1Luc Van Oostenryck1-19/+67
2017-05-19add support for a new flag: -fdump-linearize[=only]Luc Van Oostenryck1-0/+6
2017-05-19remove origval from struct access_dataLuc Van Oostenryck1-6/+0
2017-05-19remove alignment from struct access_dataLuc Van Oostenryck1-2/+1
2017-05-19fix implicit zero initializer.Luc Van Oostenryck1-0/+15
2017-05-19remove bit_size & bit_offset from struct access_dataLuc Van Oostenryck1-8/+8
2017-05-19fix: kill old branch in insert_branch()Luc Van Oostenryck1-1/+2
2017-05-12fix boolean context for OP_AND_BOOL & OP_OR_BOOLLuc Van Oostenryck1-2/+35
2017-05-12fix: kill unreachable BBs after killing a childLuc Van Oostenryck1-1/+4
2017-04-30Merge branches 'sent/float-expand-v2', 'sent/fix-kill-ttsb-v2', 'sent/fix-con...Luc Van Oostenryck1-0/+2
2017-03-31avoid crash with test-linearize -vvLuc Van Oostenryck1-0/+2
2017-03-27fix cast to pointer to floating-pointLuc Van Oostenryck1-2/+1
2017-03-06use VOID instead of directly using &void_pseudoLuc Van Oostenryck1-1/+1
2017-03-06split OP_BR between unconditional & conditional: OP_CBRLuc Van Oostenryck1-6/+8
2017-03-04fix size of loaded bitfieldsLuc Van Oostenryck1-1/+3
2017-02-13fix cast's target type infoLuc Van Oostenryck1-2/+2
2017-02-13fix value of label statementLuc Van Oostenryck1-2/+1
2017-02-13fix typing error in compound assignmentLuc Van Oostenryck1-4/+6
2017-02-13OP_SWITCH should use 'insn->cond' instead of 'insn->target'Luc Van Oostenryck1-1/+1
2017-02-13give comparable label's names to basic blocksLuc Van Oostenryck1-14/+16
2017-02-13fix discarded label statementLuc Van Oostenryck1-1/+1
2017-01-27linearize: Emit C99 declarations correctlyEmily Maier1-0/+4
2013-05-27Fix result type of relational and logical operatorsXi Wang1-2/+2
2012-02-04sparse, llvm: Make function declaration accessible to backendLinus Torvalds1-0/+8
2011-08-27Make 'linearize_return()' helper functionLinus Torvalds1-22/+26
2011-08-27Make 'linearize_switch()' helper functionLinus Torvalds1-61/+65
2011-08-27Make 'linearize_iterator()' helper functionLinus Torvalds1-40/+45
2011-04-26use ARRAY_SIZE() when possible (continued)Jan Pokorný1-1/+1
2010-03-28Fix incorrect linearization of "x && y && z"Daniel De Graaf1-1/+3
2009-07-29linearize.h: sanitize headerKamil Dudka1-3/+3
2008-12-24Revert the context tracking codeJohannes Berg1-15/+16
2008-12-18Add type information to struct instruction.David Given1-1/+3