Conversation
|
Regarding device identification, I think it's better not to pass a device name to the backend. As far as I understand, A full device name is needed only for linker to load a specific linker script. |
|
+1 to @mskvortsov |
It is also needed to generate a So, it's needed to pass the full device name to the compiler using some other ways, or decide to not to support the aforementioned feature. |
|
Right. We're talking about the backend. Essentially the toolchain should parse the device name and transform it into more fine grained stuff:
|
src/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td
Outdated
Show resolved
Hide resolved
| "hardware multiplier, but -mhwmult is set to %1.">, | ||
| InGroup<InvalidCommandLineArgument>; | ||
| def warn_drv_msp430_hwmult_no_device : Warning<"No MCU device specified, but " | ||
| "'-mhwmult' is set to 'auto', assuming no hardware multiply. Use -mmcu to " |
There was a problem hiding this comment.
Sounds okay to me. I'm even thinking about change to 'multiply' in the other warnings cause 'supports' 'multiplier' looks really weird.
Yes, I understand the idea. The driver takes -mmcu option with a particular device name and uses it to:
First is needed to generate device specific defines in frontend. For backend this option is almost unused. But it affects both. If I keep all as is and just remove Another option is to translate it to some other (maybe new) cc1 option which will be handled in frontend, but doesn't affect backend (it doesn't seems as a good option to me). |
|
Possible solution for the problem above (after discussing with Michael):
It allows to simplify msp430 support in frontend, remove useless code from backend, but likely there will be no diagnostic for unsupported mcus (all mcus names will be accepted). |
|
Well, we still could check stuff in driver and warn for unknown CPUs :) Otherwise - LGTM. |
178f732 to
167566a
Compare
888a590 to
b54dde3
Compare
b54dde3 to
52380ba
Compare
Flags variable was not initialized and later used (both isMBBSafeToOutlineFrom
implementations assume it's initialized), which breaks
test/CodeGen/AArch64/machine-outliner.mir. under memory sanitizer:
MemorySanitizer: use-of-uninitialized-value
#0 in llvm::AArch64InstrInfo::getOutliningType(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&, unsigned int) const llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5494:9
#1 in (anonymous namespace)::InstructionMapper::convertToUnsignedVec(llvm::MachineBasicBlock&, llvm::TargetInstrInfo const&) llvm/lib/CodeGen/MachineOutliner.cpp:772:19
#2 in (anonymous namespace)::MachineOutliner::populateMapper((anonymous namespace)::InstructionMapper&, llvm::Module&, llvm::MachineModuleInfo&) llvm/lib/CodeGen/MachineOutliner.cpp:1543:14
#3 in (anonymous namespace)::MachineOutliner::runOnModule(llvm::Module&) llvm/lib/CodeGen/MachineOutliner.cpp:1645:3
#4 in (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:1744:27
#5 in llvm::legacy::PassManagerImpl::run(llvm::Module&) llvm/lib/IR/LegacyPassManager.cpp:1857:44
#6 in compileModule(char**, llvm::LLVMContext&) llvm/tools/llc/llc.cpp:597:8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346761 91177308-0d34-0410-b5e6-96231b3b80d8
src/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td
Outdated
Show resolved
Hide resolved
| if (!MCUArg && !HWMultArg) | ||
| return; | ||
|
|
||
| StringRef HWMult = HWMultArg ? HWMultArg->getValue() : "auto"; |
There was a problem hiding this comment.
Вот этот код как-то вынести в отдельную функцию? Он аналогичен коду выше.
292b7b6 to
645c6da
Compare
645c6da to
577341e
Compare
577341e to
2f9616d
Compare
|
I don't know what is wrong with Travis. The patch doesn't introduce any changes in the backend and currently 'cleanly' rebased to master, but for some reason, Travis checks out and test another PR - #57. |
Introduces MSP430 toolchain, -mmcu, -mhwmult options support.
Please, take a look at.
I also would appreciate for some help with
[MSP430] Add msp430 devices list to MSP430.td
178f732 (see a comment in commit message).