In LLVM 3.1, EngineBuilder is ignoring the parameters being passed to setMArch/setMCPU/setMAttrs methods. Consequently, mcpu/march/mattr options in command line lli tool do not work. This change fixes it: index 42364f9..f46674d 100644 --- a/lib/ExecutionEngine/TargetSelect.cpp +++ b/lib/ExecutionEngine/TargetSelect.cpp @@ -26,9 +26,9 @@ using namespace llvm; TargetMachine *EngineBuilder::selectTarget() { - StringRef MArch = ""; - StringRef MCPU = ""; - SmallVector<std::string, 1> MAttrs; + //StringRef MArch = ""; + //StringRef MCPU = ""; + //SmallVector<std::string, 1> MAttrs; Triple TT(M->getTargetTriple()); return selectTarget(TT, MArch, MCPU, MAttrs); I think this is a severe functionality regression for lli. So please consider fixing this for llvm 3.1
I suspect this was introduced by commit 8e1fc56b2496270d1d6040cb648eef5d5aeb6079 Author: Owen Anderson <resistor@mac.com> Date: Fri Mar 23 17:40:56 2012 +0000 Make it feasible for clients using EngineBuilder to capture the TargetMachine that is created as part of selecting the appropriate target. This is necessary if the client wants to be able to mutate TargetOptions (for example, fast FP math mode) after the initial creation of the ExecutionEngine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153342 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed in commit 5b2d81bb50de40c94449b10c527228b9ebf2c35f Author: Owen Anderson <resistor@mac.com> Date: Mon May 21 16:57:17 2012 +0000 Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually used. Patch by Jose Fonseca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157191 91177308-0d34-0410-b5e6-96231b3b80d8 So we can close it now.