[LLVMdev] Redundant Add Operation in Code Generation?
kparzysz at codeaurora.org
Fri Oct 19 14:43:00 PDT 2012
On 10/19/2012 4:34 PM, Ryan Taylor wrote:
> That solves the issue but it seems odd to me that instcombine doesn't
> take care of it?
> So is this just a setup for the backend? If not, seems like if there is
> a possibility that lsr could create these redundant operations, should
> it not clean itself up? Or am I mistaken?
I believe that LSR uses a "context-free" SCEV expander, which will
process each fixup separately. I think that this is where the "uglygep"
code comes from. If LSR was to detect redundant expressions, it would
add complexity to the code. It would be better to simply run CSE as a
pre-ISel pass if a cleanup before code generation is necessary.
Otherwise the MI optimizations should be able to take care of this.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev