llvm::Instruction::dropUBImplyingAttrsAndUnknownMetadata

Drop non-debug unknown metadata and UB-implying call attributes.

Synopsis

Declared in <llvm/IR/Instruction.h>

void
dropUBImplyingAttrsAndUnknownMetadata(ArrayRef<unsigned int> KnownIDs = {});

Description

This drops non-debug unknown metadata (through dropUnknownNonDebugMetadata). For calls, it also drops parameter and return attributes that can cause undefined behaviour. Both of these should be done by passes which move instructions in IR.

Parameters

NameDescription
KnownIDsMetadata kind IDs that should be retained.