aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
AgeCommit message (Expand)AuthorFilesLines
2018-08-17simplify TRUNC(TRUNC(x))Luc Van Oostenryck1-0/+3
2018-08-17reorganize simplification of ZEXT(TRUNC(x))Luc Van Oostenryck1-2/+4
2018-08-08Merge branches 'fix-inc-dec-size' and 'optim-mask' into tipLuc Van Oostenryck1-7/+85
2018-08-08simplify (x & M) >> S to (x >> S) & (M >> S)Luc Van Oostenryck1-0/+14
2018-08-08simplify (x << S) >> S into x & (-1 >> S)Luc Van Oostenryck1-0/+11
2018-08-08simplify ((x & M) | y) >> S to (y >> S) when (M >> S) == 0Luc Van Oostenryck1-0/+24
2018-08-08simplify ((x & M') | y ) & M into (y & M) when (M' & M) == 0Luc Van Oostenryck1-0/+23
2018-08-08reorg code for shift-shift simplificationLuc Van Oostenryck1-5/+10
2018-08-07use multi_users() instead on nbr_users()Luc Van Oostenryck1-3/+3
2018-08-07Merge branch 'fix-logical-extra' into tipLuc Van Oostenryck1-1/+52
2018-08-07avoid infinite simplification loops of the second kindLuc Van Oostenryck1-2/+3
2018-08-06simplify AND(SETCC(x,y), M)Luc Van Oostenryck1-0/+5
2018-08-06simplify TRUNC(SETCC(x,y), N)Luc Van Oostenryck1-0/+2
2018-08-06simplify SEXT(SETCC(x,y), N)Luc Van Oostenryck1-0/+4
2018-08-06simplify ZEXT(SETCC(x,y), N)Luc Van Oostenryck1-0/+13
2018-08-06simplify SETNE(TRUNC(x,N),{0,1})Luc Van Oostenryck1-0/+17
2018-08-06simplify SETNE(AND(X,1),0) to AND(X,1)Luc Van Oostenryck1-0/+10
2018-08-06fix size corruption when simplifing 'x != 0' to 'x'Luc Van Oostenryck1-1/+1
2018-08-04Merge branch 'list-optims' (early part) into tipLuc Van Oostenryck1-2/+2
2018-07-28Merge branch 'optim-setne' into tipLuc Van Oostenryck1-15/+21
2018-07-28simplify 'x != 0' or 'x == 1' to 'x'Luc Van Oostenryck1-0/+8
2018-07-28simplify SET{EQ,NE}(SEXT(x, N),{0,1})Luc Van Oostenryck1-1/+5
2018-07-28simplify SET{EQ,NE}(ZEXT(x, N),{0,1})Luc Van Oostenryck1-10/+7
2018-07-25cleanup of simplify_seteq_setne(): remove tmp varsLuc Van Oostenryck1-5/+2
2018-07-25Merge branch 'optim-cast' into tipLuc Van Oostenryck1-11/+105
2018-07-25Merge branch 'optim-shift' into tipLuc Van Oostenryck1-9/+114
2018-07-25shift: simplify ASR(ZEXT(X, N), C)Luc Van Oostenryck1-0/+10
2018-07-25shift: avoid simplification of ASR(LSR(x,0),N)Luc Van Oostenryck1-1/+1
2018-07-25shift: simplify ASR(LSR(x,N),N')Luc Van Oostenryck1-1/+4
2018-07-25shift: simplify LSR(LSR(x,N),N') & friendsLuc Van Oostenryck1-1/+46
2018-07-25add ptr_list_multiple()Luc Van Oostenryck1-1/+1
2018-07-25add ptr_list_empty()Luc Van Oostenryck1-1/+1
2018-07-25kill dead OP_FADD & friendsLuc Van Oostenryck1-0/+7
2018-07-23big-shift: do not optimize over-sized ASRsLuc Van Oostenryck1-0/+2
2018-07-23big-shift: do not optimize negative shiftsLuc Van Oostenryck1-0/+2
2018-07-23big-shift: fix warning message for negative or over-sized shiftsLuc Van Oostenryck1-5/+18
2018-07-23big-shift: move shift count check in a separate functionLuc Van Oostenryck1-5/+16
2018-07-23cast: simplify SEXT(ZEXT(x,N),N')Luc Van Oostenryck1-0/+3
2018-07-23cast: simplify ZEXT(ZEXT(x,N),N')Luc Van Oostenryck1-0/+6
2018-07-23cast: simplify SEXT(SEXT(x,N),N')Luc Van Oostenryck1-0/+5
2018-07-23cast: simplify AND(ZEXT(x,M),N)Luc Van Oostenryck1-1/+34
2018-07-23cast: simplify [ZS]EXT(AND(x,M),N)Luc Van Oostenryck1-0/+24
2018-07-23cast: preserve the sizes of TRUNC(AND(x,M),N)Luc Van Oostenryck1-6/+11
2018-07-23cast: use a switch to handle TRUNC(AND(x,M),N) in simplify_cast()Luc Van Oostenryck1-7/+11
2018-07-23cast: do not compare sizes, test the opcodeLuc Van Oostenryck1-1/+1
2018-07-23cast: fix shift signedness in cast simplificationLuc Van Oostenryck1-1/+2
2018-07-23cast: simplify [SZ]EXT + TRUNC to a smaller/greater sizeLuc Van Oostenryck1-1/+4
2018-07-23cast: simplify [SZ]EXT + TRUNC to original sizeLuc Van Oostenryck1-0/+10
2018-07-23extract nbr_users() from unssa.cLuc Van Oostenryck1-1/+1
2018-07-23big-shift: add -Wshift-count-{negative,overflow}Luc Van Oostenryck1-1/+2
2018-07-23big-shift: use the type width for too big shiftLuc Van Oostenryck1-2/+2
2018-07-23big-shift: simplify over-sized OP_SHLsLuc Van Oostenryck1-0/+2
2018-07-23big-shift: simplify over-sized OP_LSRsLuc Van Oostenryck1-0/+8
2018-07-23big-shift: reuse simplify_asr() for LSR & SHLLuc Van Oostenryck1-4/+4
2018-07-23big-shift: reorder the tests in simplify_asr()Luc Van Oostenryck1-3/+5
2018-07-23big-shift: do not simplify over-sized OP_ASR to zeroLuc Van Oostenryck1-1/+0
2018-07-21big-shift: do not evaluate negative or over-sized shiftsLuc Van Oostenryck1-0/+6
2018-07-21big-shift: mark out-of-range OP_{ASR,LSR,SHL} as taintedLuc Van Oostenryck1-1/+2
2018-06-30fix: remove dead OP_{SETVAL,SETFVAL,SLICE}Luc Van Oostenryck1-0/+9
2018-06-30fix killing OP_SWITCHLuc Van Oostenryck1-0/+1
2018-06-30Merge branch 'cast-optim' into tipLuc Van Oostenryck1-2/+3
2018-06-29cast: optimize away casts to/from pointersLuc Van Oostenryck1-2/+3
2018-06-28bool: remove OP_{AND,OR}_BOOL instructionsLuc Van Oostenryck1-23/+0
2018-06-28bool: simplify ZEXT in bool -> int -> boolLuc Van Oostenryck1-2/+12
2018-06-28bool: fix add missing check in simplify_seteq_setne()Luc Van Oostenryck1-1/+4
2018-06-28simplify 'x ^ ~0' to '~x'Luc Van Oostenryck1-1/+7
2018-06-28simplify 'x & ~0' to 'x'Luc Van Oostenryck1-0/+2
2018-06-28simplify 'x | ~0' to '~0'Luc Van Oostenryck1-1/+8
2018-06-26cast: simplify TRUNC + ZEXT to ANDLuc Van Oostenryck1-0/+9
2018-06-23cast: prepare for more cast simplificationsLuc Van Oostenryck1-7/+10
2018-06-23cast: merge simplification of constant casts with constant unopsLuc Van Oostenryck1-23/+12
2018-06-23cast: simplify simplify_cast()Luc Van Oostenryck1-23/+4
2018-06-23new helper: def_opcode()Luc Van Oostenryck1-0/+7
2018-06-23cast: specialize integer castsLuc Van Oostenryck1-12/+12
2018-06-23cast: specialize cast from pointersLuc Van Oostenryck1-0/+1
2018-06-23cast: specialize casts from unsigned to pointersLuc Van Oostenryck1-0/+1
2018-06-23cast: specialize floats to integer conversionLuc Van Oostenryck1-0/+1
2018-06-23cast: specialize FPCAST into [USF]CVTFLuc Van Oostenryck1-2/+3
2018-06-23Merge branches 'bug-fpcast-constant', 'case-unop', 'replace-pseudo' and 'add-...Luc Van Oostenryck1-27/+24
2018-06-23ir: case OP_UNOP ... OP_UNOP_ENDLuc Van Oostenryck1-12/+2
2018-06-23add missing entry for OP_FNEG in kill_insn() & validate_insn()Luc Van Oostenryck1-1/+1
2018-06-22remove unused arg in simplify_cond_branch()Luc Van Oostenryck1-3/+3
2018-06-22new helper: replace_pseudo()Luc Van Oostenryck1-12/+19
2018-06-22avoid useless deref in simplify_cond_branch()Luc Van Oostenryck1-4/+4
2018-06-21fix bad fpcast simplificationLuc Van Oostenryck1-2/+2
2018-05-06Merge branches 'unop', 'describe-dirty', 'range-syntax', 'old-testcases', 'fi...Luc Van Oostenryck1-2/+4
2018-05-06fix: remove usage when killing symaddr (part 2)Luc Van Oostenryck1-1/+1
2018-05-06fix: remove usage when killing symaddr (part 1)Luc Van Oostenryck1-0/+1
2018-04-04fix missing handling of OP_FNEGLuc Van Oostenryck1-1/+2
2018-03-18add remove_use()Luc Van Oostenryck1-0/+8
2018-03-18make remove_usage() more genericLuc Van Oostenryck1-3/+8
2018-03-17optim: simplify null selectLuc Van Oostenryck1-0/+6
2018-03-11fix symbol cleanupLuc Van Oostenryck1-0/+2
2018-02-24fix accesses through incorrect union membersJann Horn1-5/+5
2018-02-20ban use of 'true' or 'false'Luc Van Oostenryck1-8/+6
2018-02-20no need for signed & unsigned multiplicationLuc Van Oostenryck1-10/+5
2018-02-20unsigned multiplication is also associativeLuc Van Oostenryck1-1/+1
2018-02-14kill dead loadsLuc Van Oostenryck1-1/+5
2018-02-13let kill_instruction() report if changes were madeLuc Van Oostenryck1-9/+8
2018-02-13use has_users() in dead_insn() tooLuc Van Oostenryck1-5/+2
2018-02-13add helper for pseudo's user-list's sizeLuc Van Oostenryck1-2/+2
2018-02-08Merge branches 'cse-setfval' and 'extract-eval' into tipLuc Van Oostenryck1-113/+128
2018-02-06extract extract eval_insn() from simplify_constant_binop()Luc Van Oostenryck1-113/+128
2018-01-08add OP_SETFVALLuc Van Oostenryck1-0/+1
2017-11-18fix support of floating-point compareLuc Van Oostenryck1-1/+1
2017-11-16canonicalize compare instructionsLuc Van Oostenryck1-4/+16
2017-11-16canonicalize binops before simplificationLuc Van Oostenryck1-11/+9
2017-11-16use opcode table for compare_opcode()Luc Van Oostenryck1-25/+1
2017-11-11fix 'simplification' of float-to-int castsLuc Van Oostenryck1-0/+4
2017-08-08mark pseudo users as deleted instead of removing themLuc Van Oostenryck1-2/+3
2017-07-31fix ptrlist corruption while killing unreachable BBsLuc Van Oostenryck1-0/+9
2017-05-12ignore VOID when trying to if-convert phi-nodesLuc Van Oostenryck1-6/+35
2017-03-06split OP_BR between unconditional & conditional: OP_CBRLuc Van Oostenryck1-10/+5
2017-03-04fix usage in simplify_seteq_setne()Luc Van Oostenryck1-2/+3
2017-02-16simplify float-to-float casts that doesn't change sizeLuc Van Oostenryck1-0/+2
2017-02-16add killing of storesLuc Van Oostenryck1-0/+7
2017-02-16add killing of non-volatile loadsLuc Van Oostenryck1-0/+6
2017-02-16fix killing OP_CALL via pointersLuc Van Oostenryck1-0/+2
2017-02-16add killing of pure callsLuc Van Oostenryck1-0/+11
2017-02-16kill_instruction() may need to be forced or notLuc Van Oostenryck1-1/+10
2017-02-16fix killing of otherwise not-handled instructionsLuc Van Oostenryck1-1/+3
2017-02-16remove unused clear_phi()Luc Van Oostenryck1-10/+0
2017-02-16fix clear_phi(), replace it by kill_instruction()Luc Van Oostenryck1-3/+3
2017-02-16fix killing of OP_PHIsLuc Van Oostenryck1-1/+1
2017-02-16add helper kill_use_list()Luc Van Oostenryck1-0/+10
2017-02-16add killing of OP_PHISOURCEsLuc Van Oostenryck1-0/+3
2017-02-16add killing of OP_SLICEsLuc Van Oostenryck1-0/+1
2017-02-13simplify '(x || x)' and '(x && x)'Luc Van Oostenryck1-4/+4
2017-02-13simplify comparisons followed by an equality test against 0 or 1Luc Van Oostenryck1-0/+65
2017-02-13add warning option '-Wtautological-compare'Luc Van Oostenryck1-0/+4
2017-02-13simplify '(x op x)' to '0', '1' or 'x'Luc Van Oostenryck1-0/+35
2017-02-13simplify '(x || 1)' to '1'Luc Van Oostenryck1-1/+6
2017-02-13simplify '~(~x)' and '-(-x)' to 'x'Luc Van Oostenryck1-0/+17
2017-02-13simplify '(x % 1)' into '0'Luc Van Oostenryck1-0/+5
2017-02-13simplify '(x / -1)' to '-x' (but only for signed division)Luc Van Oostenryck1-0/+2
2017-02-13simplify '(x * -1)' to '-x'Luc Van Oostenryck1-0/+11
2017-02-13simplify '(x / 1)' to 'x'Luc Van Oostenryck1-0/+1
2017-02-13move OP_MUL simplification in a separate functionLuc Van Oostenryck1-0/+17
2017-02-13fix killing OP_SETVAL instructionsLuc Van Oostenryck1-0/+1
2017-02-13cleanup kill_instruction()Luc Van Oostenryck1-26/+21
2017-02-13explicitely ignore killing OP_ENTRYLuc Van Oostenryck1-0/+4
2017-02-13fix killing OP_COMPUTEDGOTOLuc Van Oostenryck1-0/+1
2017-02-13fix killing OP_SELECTLuc Van Oostenryck1-0/+1
2017-02-13fix killing OP_CAST & friendsLuc Van Oostenryck1-0/+4
2017-02-13fix killing OP_PHI instructionsLuc Van Oostenryck1-0/+1
2017-02-13kill uses of replaced instructionsLuc Van Oostenryck1-0/+20
2017-02-13fix crash while testing between conditional & unconditional OP_BRLuc Van Oostenryck1-1/+1
2013-05-11fix SIGFPE caused by signed division overflowXi Wang1-0/+4
2012-05-10simplify: conservative handling of casts with pointersJan Pokorný1-0/+6
2008-04-24Simplify (and warn about) right shifts that result in zeroLinus Torvalds1-1/+56
2007-04-20simplify.c: Declare delete_pseudo_user_list_entry staticJosh Triplett1-1/+1
2007-03-09Fix typos in commentsJosh Triplett1-3/+3
2007-01-16Add a return in the last case of a switch; redundant but less error-prone.Josh Triplett1-0/+1
2007-01-16Update usage chain for dead instructionsChristopher Li1-0/+5
2007-01-16Add instruction to pseudo user tracking.Christopher Li1-15/+32
2006-11-06Typo fixesPavel Roskin1-1/+1
2005-11-20Simplify some more instructionsLinus Torvalds1-2/+28
2005-04-07Fix typo (duplicate src2 should be src3) in simplify_rangeLinus Torvalds1-1/+1
2005-04-07Use the new per-instruction position information for betterLinus Torvalds1-2/+2
2005-04-07Make range check code a bit more readable (and more easily extensible).Linus Torvalds1-5/+16
2005-04-07Add compile-time "range-check" infrastructure to sparseLinus Torvalds1-4/+32
2005-04-07Make simplification remove casts that change neither size nor sign.Linus Torvalds1-1/+12
2005-04-07Split OP_CAST into signed, unsigned and FP casts.Linus Torvalds1-2/+4
2005-04-07Simplify OP_CAST of OP_AND.Linus Torvalds1-7/+21
2005-04-07Make constant instruction simplification take the sign of theLinus Torvalds1-20/+29
2005-04-07Split the binops where signedness matters into unsigned and signed.Linus Torvalds1-16/+23
2005-04-07Don't try to recursively check for an associative insn.Linus Torvalds1-0/+2
2005-04-07Simplify OP_PTRCAST ops too for now.Linus Torvalds1-1/+1
2005-04-07Split OP_SETVAL into OP_SETVAL (fp expressions and labels) and OP_SYMADDRLinus Torvalds1-6/+4
2005-04-07Simplify conditional on cast-to-larger-size to conditional on original.Linus Torvalds1-0/+8
2005-04-07Oops. Didn't remember about BINCMP ops when doing the commutativeLinus Torvalds1-0/+5
2005-04-07Teach simplification about associative operators.Linus Torvalds1-3/+39
2005-04-07Make commutative operations use a canonical order.Linus Torvalds1-1/+40
2005-04-07Remove OP_SETVAL after symbol-pseudo simplification.Linus Torvalds1-1/+1
2005-04-07Make OP_PHISOURCE track the OP_PHI instructions that it defines.Linus Torvalds1-1/+1
2005-04-07Simplify constant unopsLinus Torvalds1-1/+18
2005-04-07Fix conditional branch to same target simplification.Linus Torvalds1-0/+12
2005-04-07Oops. OP_SEL simplification tried to kill the wrong pseudo ;)Linus Torvalds1-1/+1
2005-04-07Follow OP_SEL -> OP_BR flow and simplify the branch.Linus Torvalds1-0/+23
2005-04-07Remove OP_SETCC, make OP_SEL bigger instead.Linus Torvalds1-30/+22
2005-04-07When simplifying memops, follow the whole chain of adds/subs.Linus Torvalds1-2/+18
2005-04-07Simplify seteq/setne $0 + conditional branch.Linus Torvalds1-3/+37
2005-04-07Don't try to share parenthood fn between phi node removal and Linus Torvalds1-12/+2
2005-04-07Simplify "setcc + select $0<->$1" into "setne/seteq".Linus Torvalds1-7/+29
2005-04-07Move constant switch simplification to the instructionLinus Torvalds1-0/+27
2005-04-07Cleanup. Move the OP_SEL and OP_BR simplification out intoLinus Torvalds1-18/+29
2005-04-07Simplify trivial casts (and handle pointers specially).Linus Torvalds1-0/+19
2005-04-07Don't go off into infinite loops when some undefined programLinus Torvalds1-0/+7
2005-04-07Start using instruction sizes properly.Linus Torvalds1-1/+1
2005-04-07Make list-ptr remove/replace take a count.Linus Torvalds1-3/+1
2005-04-07Expose the "trivial common parent" logic that we use for phiLinus Torvalds1-2/+12
2005-04-07Teach 'memop' simplification about offsetting.Linus Torvalds1-0/+19
2005-04-07Simplify constant subtraction into addition.Linus Torvalds1-1/+8
2005-04-07Add some more trivial constant simplifications.Linus Torvalds1-0/+14
2005-04-07Clean up the tests for "pseudo has use list", since add/removeLinus Torvalds1-1/+1
2005-04-07Make the CSE "repeat" logic be more fine-grained than justLinus Torvalds1-15/+26
2005-04-07Handle killing of usage chains.Linus Torvalds1-18/+46
2005-04-07More instruction kill care, making sure the use chainsLinus Torvalds1-2/+5
2005-04-07Be more thorough about killing unreachable instructions.Linus Torvalds1-6/+6
2005-04-07Notice killed phi-sources, and don't bother with them.Linus Torvalds1-1/+4