Hi All,
Submitted a patch related to subtraction optimization.
The optimization is :
(X + Y) - (X + Z) --> (Y - Z)
Please help in reviewing it.
Regards,
Sonam.
Differential D5813
Added a new transformation " (X + Y) - (X + Z) --> (Y - Z) " sonamkumari on Oct 15 2014, 11:43 PM. Authored by
Details
Hi All, Submitted a patch related to subtraction optimization. The optimization is : Please help in reviewing it. Regards,
Diff Detail Event TimelineComment Actions This instcombine is definitely not needed. This sort of thing is best handled by reassociate. In fact, it already handles this case today: ~/llvm/Debug+Asserts/bin/opt -reassociate -instcombine t.ll -o - -S define i32 @test45(i32 %x, i32 %y, i32 %z) { %sub = sub i32 %y, %z ret i32 %sub } Comment Actions Hi David, Thanks for pointing out the mistake and reviewing the patch. Regards, |