Outliner: add "target-cpu" feature from source function to outlined
The CPU is used to determine which inline asm instructions are allowed, so needs to be copied across in case the outlined function contains any.
This commit is contained in:
parent
e208bab55f
commit
b586dc21a7
|
@ -1411,6 +1411,8 @@ void TargetInstrInfo::mergeOutliningCandidateAttributes(
|
|||
const Function &ParentFn = FirstCand.getMF()->getFunction();
|
||||
if (ParentFn.hasFnAttribute("target-features"))
|
||||
F.addFnAttr(ParentFn.getFnAttribute("target-features"));
|
||||
if (ParentFn.hasFnAttribute("target-cpu"))
|
||||
F.addFnAttr(ParentFn.getFnAttribute("target-cpu"));
|
||||
|
||||
// Set nounwind, so we don't generate eh_frame.
|
||||
if (llvm::all_of(Candidates, [](const outliner::Candidate &C) {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
; TARGET_FEATURES-SAME: minsize
|
||||
; TARGET_FEATURES-SAME: nounwind
|
||||
; TARGET_FEATURES-SAME: optsize
|
||||
; TARGET_FEATURES-SAME: "target-cpu"="cyclone"
|
||||
; TARGET_FEATURES-SAME: "target-features"="+sse"
|
||||
|
||||
define linkonce_odr void @fish() #0 {
|
||||
|
|
Loading…
Reference in New Issue