summaryrefslogtreecommitdiff
path: root/tools/llc/llc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llc/llc.cpp')
-rw-r--r--tools/llc/llc.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 145d957890c..b7756129155 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -304,8 +304,11 @@ static int compileModule(char **argv, LLVMContext &Context) {
if (const DataLayout *DL = Target->getDataLayout())
M->setDataLayout(*DL);
- // Override function attributes based on CPUStr and FeaturesStr.
- setFunctionAttributes(CPUStr, FeaturesStr, *M);
+ // Override function attributes based on CPUStr, FeaturesStr, and Options.
+ // Pass AlwaysRecordAttrs=false as we want to override an attribute only when
+ // the corresponding cl::opt has been provided on llc's command line.
+ setFunctionAttributes(CPUStr, FeaturesStr, Options, *M,
+ /* AlwaysRecordAttrs */ false);
if (RelaxAll.getNumOccurrences() > 0 &&
FileType != TargetMachine::CGFT_ObjectFile)