[llvm-bugs] [Bug 42283] gvn-hoist produces wrong code with "opt -sroa -loop-unswitch -loop-rotate -sccp -jump-threading -gvn-hoist"

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 12 23:21:43 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=42283

hiraditya <hiraditya at msn.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Assignee|unassignedbugs at nondot.org   |hiraditya at msn.com
                 CC|                            |hiraditya at msn.com
         Resolution|---                         |FIXED

--- Comment #2 from hiraditya <hiraditya at msn.com> ---
Doesn't repro in llvm trunk and gvn-hoist hoists loads, and scalars.

>From the testcase small.c attached in the comments above.


$clang -O3 -c -emit-llvm  -mllvm -disable-llvm-optzns small.c
$opt -sroa -loop-unswitch -loop-rotate -sccp -jump-threading -gvn-hoist
small.bc -o small-opt.bc
$clang small-opt.bc  -o small3.out && ./small3.out
28

And:

./bin/opt -sroa -loop-unswitch -loop-rotate -sccp -jump-threading -gvn-hoist
small.bc -o small-opt.bc -stats

```
 2 gvn-hoist      - Number of instructions hoisted
 1 gvn-hoist      - Number of loads hoisted
 1 gvn-hoist      - Number of loads removed
 2 gvn-hoist      - Number of instructions removed
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200813/cc58c126/attachment.html>


More information about the llvm-bugs mailing list