Skip to content

Instantly share code, notes, and snippets.

View rwy7's full-sized avatar
✌️

Robert Young rwy7

✌️
  • Sifive
  • Ontario, Canada
  • 01:47 (UTC -12:00)
View GitHub Profile
@rwy7
rwy7 / keybase.md
Last active August 29, 2015 14:07
keybase.md

Keybase proof

I hereby claim:

  • I am youngrw on github.
  • I am rwyoung (https://keybase.io/rwyoung) on keybase.
  • I have a public key whose fingerprint is 5B8F 1C9D 2A24 1BDE 3DDB A2E7 E6FA A214 58EC A358

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am rwy0717 on github.
  • I am rwyoung (https://keybase.io/rwyoung) on keybase.
  • I have a public key whose fingerprint is 5B8F 1C9D 2A24 1BDE 3DDB A2E7 E6FA A214 58EC A358

To claim this, I am signing this object:

#if !defined(OMR_OM_CELLWALKER_HPP_)
#define OMR_OM_CELLWALKER_HPP_
#include <OMR/Om/Any.hpp>
enum class WalkInstruction { CONTINUE, PAUSE };
enum class WalkResult { COMPLETE, MORE_SLOTS, ERROR };
class ObjectScanner {
// This is a generated file. Do not edit!
#ifndef OMR_COMPILER_DETECTION_H
#define OMR_COMPILER_DETECTION_H
#ifdef __cplusplus
# define OMR_COMPILER_IS_Comeau 0
# define OMR_COMPILER_IS_Intel 0
# define OMR_COMPILER_IS_PathScale 0
@rwy7
rwy7 / example.cpp
Created December 19, 2018 15:50
WebKit, with 120 line column, no brace wrapping, double indentation for line continuations
bool TR_GeneralLoopUnroller::canUnrollUnCountedLoop(
TR_RegionStructure* loop, int32_t numBlocks, int32_t numNodes, int32_t entryBlockFrequency) {
if (comp()->getOption(TR_DisableUncountedUnrolls))
return false;
if (entryBlockFrequency * 6 > (MAX_BLOCK_COUNT + MAX_COLD_BLOCK_COUNT))
return true;
// Detect Small loops like:
// [0x37047e24] BBStart (block 133) (frequency 127) (is in loop 133)
@rwy7
rwy7 / replacePassThroughIfPossible.cpp
Created December 19, 2018 15:56
Format: WebKit, with 120 line column, no brace wrapping, double indentation for line continuations
bool TR_CompactNullChecks::replacePassThroughIfPossible(TR::Node* currentNode, TR::Node* referenceChild,
TR::Node* prevNode, TR::Node* currentParent, bool* isTreeTopNode, TR_BitVector* writtenSymbols,
vcount_t visitCount, vcount_t initialVisitCount, TR::TreeTop* currentTree) {
if (currentNode->getVisitCount() == visitCount)
return false;
if (currentNode->getVisitCount() == initialVisitCount)
return false;
currentNode->setVisitCount(visitCount);
/*******************************************************************************
* clang-format: off
* Copyright (c) 2017, 2018 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at http://eclipse.org/legal/epl-2.0
* or the Apache License, Version 2.0 which accompanies this distribution
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
*
@rwy7
rwy7 / SIMPLIFY_BRANCH_ARITHMETIC.cpp
Created January 7, 2019 21:39
SIMPLIFY_BRANCH_ARITHMETIC
#define SIMPLIFY_BRANCH_ARITHMETIC(Type, Width) \
if ((firstChild->getOpCode().isSub() || firstChild->getOpCode().isAdd()) \
&& (firstChild->getSecondChild()->getOpCode().isLoadConst()) \
&& (secondChild->getOpCode().isSub() || secondChild->getOpCode().isAdd()) \
&& (secondChild->getSecondChild()->getOpCode().isLoadConst()) \
&& (firstChild->getReferenceCount() == 1) \
&& (secondChild->getReferenceCount() == 1)) { \
Width konst; \
if (firstChild->getOpCode().isSub()) {
// Branch factor, power of two.
static constexpr SizeP2 RADIX = SIZEP2_32;
enum class NodeKind {
LEAF = 1, BRANCH
};
class Node : public RefCounted {
public:
constexpr Node(NodeKind kind) noexcept : kind_(kind) {}
#if !defined(AB_RC_HPP_)
#define AB_RC_HPP_
#include <Ab/PtrLike.hpp>
#include <Ab/StaticPoly.hpp>
#include <cassert>
#include <stdio.h>
namespace Ab {