Skip to content

simple loop pessimized by -std-compile-opts #4132

@nlewycky

Description

@nlewycky
Bugzilla Link 3760
Resolution INVALID
Resolved on Nov 07, 2018 00:17
Version trunk
OS Linux
CC @sunfishcode

Extended Description

This simple program:

define void @​test(i32 %x, i32** %y) {
entry:
br label %loop

loop: ; preds = %loop, %entry
%tmp = phi i32 [ 0, %entry ], [ %tmp1, %loop ] ; [#uses=1]
%tmp1 = add i32 %tmp, 1 ; [#uses=2]
%my = malloc i32 ; <i32*> [#uses=1]
%z = getelementptr i32** %y, i32 %tmp
store i32* %my, i32** %z
%done = icmp eq i32 %tmp1, %x ; [#uses=1]
br i1 %done, label %out, label %loop

out: ; preds = %loop
ret void
}

is rewritten to use i64 induction variable and then zext/sext/trunc is added all over to fix it up. On x86 the resulting .s is much worse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a bugloopoptim

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions