[mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
authorRiver Riddle <riddleriver@gmail.com>
Sat, 7 Mar 2020 07:01:49 +0000 (23:01 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Sat, 7 Mar 2020 07:01:49 +0000 (23:01 -0800)
MSVC

MSVC has problems if the type of the bitfield is different, leading to
invalid code generation.

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

index e5c6c56..69d5e97 100644 (file)
@@ -1176,12 +1176,12 @@ void OpEmitter::genSideEffectInterfaceMethods() {
     unsigned index : 30;
 
     /// The kind of the location.
-    EffectKind kind : 2;
+    unsigned kind : 2;
   };
 
   StringMap<SmallVector<EffectLocation, 1>> interfaceEffects;
   auto resolveDecorators = [&](Operator::var_decorator_range decorators,
-                               unsigned index, EffectKind kind) {
+                               unsigned index, unsigned kind) {
     for (auto decorator : decorators)
       if (SideEffect *effect = dyn_cast<SideEffect>(&decorator))
         interfaceEffects[effect->getInterfaceTrait()].push_back(