diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-07-31 01:52:33 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-07-31 01:52:33 +0000 |
commit | db9552f4a4ca7cd8edf786037b2db948dfac1b1e (patch) | |
tree | c7106a0589371dbaae60d1b46313ea4558118912 /clang/lib/CodeGen/CGStmt.cpp | |
parent | 4cc54cbb9031faa4cee0863d882c2b99c1bb89da (diff) | |
download | bcm5719-llvm-db9552f4a4ca7cd8edf786037b2db948dfac1b1e.tar.gz bcm5719-llvm-db9552f4a4ca7cd8edf786037b2db948dfac1b1e.zip |
Revert r214333, "Add a state variable to the loop hint attribute."
It brought undefined behavior.
llvm-svn: 214376
Diffstat (limited to 'clang/lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index df30892e869..d75b97ddf6a 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -588,7 +588,6 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context, continue; LoopHintAttr::OptionType Option = LH->getOption(); - LoopHintAttr::LoopHintState State = LH->getState(); int ValueInt = LH->getValue(); const char *MetadataName; @@ -603,8 +602,8 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context, break; case LoopHintAttr::Unroll: // With the unroll loop hint, a non-zero value indicates full unrolling. - MetadataName = State == LoopHintAttr::Disable ? "llvm.loop.unroll.disable" - : "llvm.loop.unroll.full"; + MetadataName = + ValueInt == 0 ? "llvm.loop.unroll.disable" : "llvm.loop.unroll.full"; break; case LoopHintAttr::UnrollCount: MetadataName = "llvm.loop.unroll.count"; @@ -615,7 +614,7 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context, switch (Option) { case LoopHintAttr::Vectorize: case LoopHintAttr::Interleave: - if (State != LoopHintAttr::Disable) { + if (ValueInt == 1) { // FIXME: In the future I will modifiy the behavior of the metadata // so we can enable/disable vectorization and interleaving separately. Name = llvm::MDString::get(Context, "llvm.loop.vectorize.enable"); |