[llvm-commits] [llvm] r74329 - in /llvm/trunk/lib/Target/ARM: ARM.h ARMCodeEmitter.cpp ARMISelDAGToDAG.cpp ARMInstrInfo.cpp ARMInstrInfo.h ARMTargetAsmInfo.cpp ARMTargetAsmInfo.h ARMTargetMachine.cpp ARMTargetMachine.h AsmPrinter/ARMAsmPrinter.cp

Anton Korobeynikov anton at korobeynikov.info
Sat Jun 27 01:31:30 PDT 2009


Hello, Everyone

> ThumbTargetMachine should inherit from ARMTargetMachine so it be
> possible to go back to ARM mode.
I tried to go this way, but it seems this is not a proper solution:
1. This leads to the same ugly dispatching code in the methods.
For example, we need to create TargetData object. Possible ways are:
 - dispatch on isThumb in base class. This is same as stuff was before
refactoring
 - duplicate the object in inherited class and forget about one in
base. This leads to memory overhead but also to very dangerous
situations, when improper TargetData object might be used.
2. ISel stuff is not "pure" wrt changing TargetMachine on-fly: it
tends to cache many stuff in class instance vars, etc.

I think proper solution would be to have two isel instances: one
populated with ARMTargetMachine, one - with Thumb and switch between
these two isel instances on-fly during invocation of isel on given
function.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list