LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 45291 - ValueMapper does not preserve inline assembly dialect when remapping the type
Summary: ValueMapper does not preserve inline assembly dialect when remapping the type
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-24 06:52 PDT by Tomasz Miąsko
Modified: 2020-05-17 15:42 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s): 5f65faef2c61bfb5e041f74db61665f43a05e9db


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Miąsko 2020-03-24 06:52:49 PDT
Downstream bug report: https://github.com/rust-lang/rust/issues/70337

diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index da68d3713b4..d6b01a12b93 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -364,17 +364,18 @@ Value *Mapper::mapValue(const Value *V) {
   if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) {
     // Inline asm may need *type* remapping.
     FunctionType *NewTy = IA->getFunctionType();
     if (TypeMapper) {
       NewTy = cast<FunctionType>(TypeMapper->remapType(NewTy));
 
       if (NewTy != IA->getFunctionType())
         V = InlineAsm::get(NewTy, IA->getAsmString(), IA->getConstraintString(),
-                           IA->hasSideEffects(), IA->isAlignStack());
+                           IA->hasSideEffects(), IA->isAlignStack(),
+                           IA->getDialect());
     }
 
     return getVM()[V] = const_cast<Value *>(V);
   }
 
   if (const auto *MDV = dyn_cast<MetadataAsValue>(V)) {
     const Metadata *MD = MDV->getMetadata();
Comment 1 Craig Topper 2020-05-17 15:42:58 PDT
Commited in 5f65faef2c61bfb5e041f74db61665f43a05e9db