Displaying 1 result from an estimated 1 matches for "tcc_free".
Did you mean:
dqc_free
2015 Feb 03
2
[LLVMdev] RFC: Constant Hoisting
...kend adopt my approach.
So firstly, I think the best way to solve this problem is to avoid this
problem
in the first place. Just don't hoist these values.
For the X86 backend, X86TTI::getIntImmCost() in X86TargetTransformInfo.cpp
is an overridden function. Just mark these 1 bit masks there as TCC_Free:
// Don't hoist 1 bit masks. They'll probably be used for BT, BTS, BTC.
if (Imm.isPowerOf2()) // this could be limited to bits 32-63
return TCC_Free;
This works. Its only downside is when these values are being used twice
AND then not being combined into another instruction...