[llvm-bugs] [Bug 28208] New: Reassociate reports change made incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 20 08:51:05 PDT 2016


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

            Bug ID: 28208
           Summary: Reassociate reports change made incorrectly
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: apilipenko at azulsystems.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Reassociate pass returns true with no change made on the following function:
define i64 @test(i64 %a, i64 %b) {
  %1 = and i64 %b, %a
  ret i64 %1
}

opt -S reassociate.ll -reassociate -debug-pass=Executions

[2016-06-20 08:55:35.332437000] 0x1906670   Executing Pass 'Function Pass
Manager' on Module 'simple.ll'...
[2016-06-20 08:55:35.332704000] 0x1908770     Executing Pass 'Reassociate
expressions' on Function 'test'...
[2016-06-20 08:55:35.333682000] 0x1908770     *Made Modification* 'Reassociate
expressions' on Function 'test'...
[2016-06-20 08:55:35.333792000] 0x1908770      Freeing Pass 'Reassociate
expressions' on Function 'test'...
[2016-06-20 08:55:35.333837000] 0x1908770     Executing Pass 'Module Verifier'
on Function 'test'...
[2016-06-20 08:55:35.334012000] 0x1908770      Freeing Pass 'Module Verifier'
on Function 'test'...
[2016-06-20 08:55:35.334048000] 0x1906670   Made Modification 'Function Pass
Manager' on Module 'simple.ll'...
[2016-06-20 08:55:35.334077000] 0x1906670   Executing Pass 'Print module to
stderr' on Module 'simple.ll'...

It happens because it performs two distinct transformations which nullify each
other (canonicalizeOperands swaps arguments of an and and then
ReassociateExpression swaps them back).

-- 
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/20160620/279dfc7c/attachment.html>


More information about the llvm-bugs mailing list