[LLVMdev] how to turn off conversion of add's into or's (in address calculations)

Krzysztof Parzyszek kparzysz at codeaurora.org
Fri Jun 6 11:27:03 PDT 2014


On 6/6/2014 12:55 PM, Matt Arsenault wrote:
> On 06/06/2014 09:38 AM, Jingyue Wu wrote:
>> HI Helkki,
>>
>> I guess instcombine does that. See InstCombineAddSub.cpp:1107. The
>> optimization there is more general than converting address computation
>> adds. If A and B don't have common bits, instcombine converts A + B to
>> A | B. I am not aware of any configuration to turn this particular
>> optimization off. If you just want to experiment, you can always
>> change the code. Or you can improve your analysis/optimization to
>> treat such OR as ADD.
>>
>> Ignore if you already know this: you can run "opt -O3
>> -print-after-all" to figure out which optimization pass does a certain
>> thing.
>>
>> Jingyue
> Add the IR level, most / nearly all address calculations are hidden in
> GEPs. They are only really exposed later in SelectionDAG, so DAGCombiner
> is probably doing this

Both DAG combiner and inst-combine do it.  Also, there is some code in 
PEI(?) that does that too when generating addressing code for frame 
objects.  You'd need to, ahem, turn it off, in all these places...

-Krzysztof


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list