aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorNecip Fazil Yildiran <necip@google.com>2024-04-03 15:20:04 -0700
committerprabhukr <prabhukr@google.com>2024-04-03 15:20:04 -0700
commit71a46c10cced25d66d36bb224131e75b79768397 (patch)
tree9ebc98309a3b662205acadd38b306447e6bd4e37 /llvm/lib/AsmParser
parent029e1d751503268e3d8b01db769e710835c3010d (diff)
parent4963b5cf66f47be76d1db52caab0aa83e707538e (diff)
downloadllvm-71a46c10cced25d66d36bb224131e75b79768397.zip
llvm-71a46c10cced25d66d36bb224131e75b79768397.tar.gz
llvm-71a46c10cced25d66d36bb224131e75b79768397.tar.bz2
Created using spr 1.3.6-beta.1
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index fe49e52..abd8a58 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3091,9 +3091,21 @@ bool LLParser::parseOptionalOperandBundles(
return true;
Type *Ty = nullptr;
- Value *Input = nullptr;
- if (parseType(Ty) || parseValue(Ty, Input, PFS))
+ if (parseType(Ty))
return true;
+
+ Value *Input = nullptr;
+ // FIXME: Metadata operand bundle value is garbage when LLVM IR is
+ // compiled to bitcode, then disassembled back to LLVM IR. See D107039
+ // for the reproducers, and https://bugs.llvm.org/show_bug.cgi?id=51264
+ // for the bug report.
+ if (Ty->isMetadataTy()) {
+ if (parseMetadataAsValue(Input, PFS))
+ return true;
+ } else {
+ if (parseValue(Ty, Input, PFS))
+ return true;
+ }
Inputs.push_back(Input);
}